Skip to content

Commit

Permalink
Add prefix list- to --interfaces and --reporters options (#3962)
Browse files Browse the repository at this point in the history
  • Loading branch information
parksb authored and juergba committed Aug 7, 2019
1 parent 6df1284 commit 9d3c584
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docs/index.md
Expand Up @@ -892,8 +892,8 @@ Positional Arguments
Other Options
--help, -h Show usage information & exit [boolean]
--version, -V Show version number & exit [boolean]
--interfaces List built-in user interfaces & exit [boolean]
--reporters List built-in reporters & exit [boolean]
--list-interfaces List built-in user interfaces & exit [boolean]
--list-reporters List built-in reporters & exit [boolean]
Mocha Resources
Chat: https://gitter.im/mochajs/mocha
Expand Down
4 changes: 2 additions & 2 deletions lib/cli/one-and-dones.js
Expand Up @@ -48,14 +48,14 @@ exports.ONE_AND_DONES = {
* Dump list of built-in interfaces
* @private
*/
interfaces: () => {
'list-interfaces': () => {
showKeys(Mocha.interfaces);
},
/**
* Dump list of built-in reporters
* @private
*/
reporters: () => {
'list-reporters': () => {
showKeys(Mocha.reporters);
}
};
Expand Down
4 changes: 2 additions & 2 deletions lib/cli/run-option-metadata.js
Expand Up @@ -36,11 +36,11 @@ exports.types = {
'full-trace',
'growl',
'inline-diffs',
'interfaces',
'invert',
'list-interfaces',
'list-reporters',
'no-colors',
'recursive',
'reporters',
'sort',
'watch'
],
Expand Down
16 changes: 8 additions & 8 deletions lib/cli/run.js
Expand Up @@ -147,14 +147,18 @@ exports.builder = yargs =>
'Display actual/expected differences inline within each string',
group: GROUPS.OUTPUT
},
interfaces: {
conflicts: Array.from(ONE_AND_DONE_ARGS),
description: 'List built-in user interfaces & exit'
},
invert: {
description: 'Inverts --grep and --fgrep matches',
group: GROUPS.FILTERS
},
'list-interfaces': {
conflicts: Array.from(ONE_AND_DONE_ARGS),
description: 'List built-in user interfaces & exit'
},
'list-reporters': {
conflicts: Array.from(ONE_AND_DONE_ARGS),
description: 'List built-in reporters & exit'
},
'no-colors': {
description: 'Force-disable color output',
group: GROUPS.OUTPUT,
Expand Down Expand Up @@ -183,10 +187,6 @@ exports.builder = yargs =>
group: GROUPS.OUTPUT,
requiresArg: true
},
reporters: {
conflicts: Array.from(ONE_AND_DONE_ARGS),
description: 'List built-in reporters & exit'
},
'reporter-option': {
coerce: opts =>
list(opts).reduce((acc, opt) => {
Expand Down
Expand Up @@ -5,7 +5,7 @@ var invokeMocha = helpers.invokeMocha;
var escapeRegExp = helpers.escapeRegExp;
var interfaces = require('../../../lib/mocha').interfaces;

describe('--interfaces', function() {
describe('--list-interfaces', function() {
it('should dump a list of all interfaces with descriptions', function(done) {
var expected = Object.keys(interfaces)
.filter(function(name) {
Expand All @@ -18,7 +18,7 @@ describe('--interfaces', function() {
};
});

invokeMocha(['--interfaces'], function(err, result) {
invokeMocha(['--list-interfaces'], function(err, result) {
if (err) {
return done(err);
}
Expand Down
Expand Up @@ -5,7 +5,7 @@ var invokeMocha = helpers.invokeMocha;
var escapeRegExp = helpers.escapeRegExp;
var reporters = require('../../../lib/mocha').reporters;

describe('--reporters', function() {
describe('--list-reporters', function() {
it('should dump a list of all reporters with descriptions', function(done) {
var expected = Object.keys(reporters)
.filter(function(name) {
Expand All @@ -21,7 +21,7 @@ describe('--reporters', function() {
};
});

invokeMocha(['--reporters'], function(err, result) {
invokeMocha(['--list-reporters'], function(err, result) {
if (err) {
return done(err);
}
Expand Down

0 comments on commit 9d3c584

Please sign in to comment.