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

ensure all CLI options have an assigned type; closes #3683 #3691

Merged
merged 1 commit into from
Jan 25, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/cli/run-option-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ exports.types = {
'bail',
'check-leaks',
'color',
'delay',
'diff',
'exit',
'forbid-only',
'forbid-pending',
'full-trace',
'growl',
'inline-diffs',
'interfaces',
'invert',
'no-colors',
'recursive',
'reporters',
'sort',
'watch'
],
number: ['retries', 'slow', 'timeout'],
Expand Down
24 changes: 24 additions & 0 deletions test/node-unit/cli/run.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

const {builder} = require('../../../lib/cli/run');
const {types} = require('../../../lib/cli/run-option-metadata');

describe('command', function() {
describe('run', function() {
describe('builder', function() {
const IGNORED_OPTIONS = new Set(['help', 'version']);
const options = builder(require('yargs')).getOptions();
['number', 'string', 'boolean', 'array'].forEach(type => {
describe(`${type} type`, function() {
Array.from(new Set(options[type])).forEach(option => {
if (!IGNORED_OPTIONS.has(option)) {
it(`should include option ${option}`, function() {
expect(types[type], 'to contain', option);
});
}
});
});
});
});
});
});