run-option-metadata.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. 'use strict';
  2. /**
  3. * Metadata about various options of the `run` command
  4. * @see module:lib/cli/run
  5. * @module
  6. * @private
  7. */
  8. /**
  9. * Dictionary of yargs option types to list of options having said type
  10. * @type {{string:string[]}}
  11. * @private
  12. */
  13. exports.types = {
  14. array: [
  15. 'exclude',
  16. 'extension',
  17. 'file',
  18. 'global',
  19. 'require',
  20. 'reporter-option',
  21. 'spec'
  22. ],
  23. boolean: [
  24. 'allow-uncaught',
  25. 'async-only',
  26. 'bail',
  27. 'check-leaks',
  28. 'color',
  29. 'delay',
  30. 'diff',
  31. 'exit',
  32. 'forbid-only',
  33. 'forbid-pending',
  34. 'full-trace',
  35. 'growl',
  36. 'inline-diffs',
  37. 'interfaces',
  38. 'invert',
  39. 'no-colors',
  40. 'recursive',
  41. 'reporters',
  42. 'sort',
  43. 'watch'
  44. ],
  45. number: ['retries', 'slow', 'timeout'],
  46. string: ['fgrep', 'grep', 'package', 'reporter', 'ui']
  47. };
  48. /**
  49. * Option aliases keyed by canonical option name.
  50. * Arrays used to reduce
  51. * @type {{string:string[]}}
  52. * @private
  53. */
  54. exports.aliases = {
  55. 'async-only': ['A'],
  56. bail: ['b'],
  57. color: ['c', 'colors'],
  58. extension: ['watch-extensions'],
  59. fgrep: ['f'],
  60. global: ['globals'],
  61. grep: ['g'],
  62. growl: ['G'],
  63. invert: ['i'],
  64. 'no-colors': ['C'],
  65. reporter: ['R'],
  66. 'reporter-option': ['reporter-options', 'O'],
  67. require: ['r'],
  68. slow: ['s'],
  69. sort: ['S'],
  70. timeout: ['t', 'timeouts'],
  71. ui: ['u'],
  72. watch: ['w']
  73. };