Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefix list- to --interfaces and --reporters options #3962

Merged
merged 5 commits into from Aug 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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