Skip to content

Commit

Permalink
Fix code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jan 15, 2019
1 parent 4e7f923 commit 49d9d77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions lib/cli/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

const Mocha = require('../mocha');
const ansi = require('ansi-colors');
const errors = require('../errors');
const createInvalidArgumentValueError = errors.createInvalidArgumentValueError;
const createMissingArgumentError = errors.createMissingArgumentError;
const {
createInvalidArgumentValueError,
createMissingArgumentError
} = require('../errors');

const {
list,
Expand Down Expand Up @@ -261,17 +262,15 @@ exports.builder = yargs =>
if (argv.invert && !('fgrep' in argv || 'grep' in argv)) {
throw createMissingArgumentError(
'"--invert" requires one of "--fgrep <str>" or "--grep <regexp>"',
'--invert',
argv.invert
'--fgrep|--grep',
'string|regexp'
);
}

if (argv.compilers) {
throw createInvalidArgumentValueError(
`--compilers is DEPRECATED and no longer supported.
See ${ansi.cyan('https://git.io/vdcSr')} for migration information.`,
'--compilers',
argv.compilers
See ${ansi.cyan('https://git.io/vdcSr')} for migration information.`
);
}

Expand Down
4 changes: 2 additions & 2 deletions test/integration/options.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ describe('options', function() {
});
});

it('fails if no --grep', function(done) {
it('should throw an error when `--invert` used in isolation', function(done) {
args = ['--invert'];
runMocha(
'options/grep.fixture.js',
Expand All @@ -359,7 +359,7 @@ describe('options', function() {
}
expect(res, 'to satisfy', {
code: 1,
output: /fgrep/
output: /--invert.*--grep <regexp>/
});
done();
},
Expand Down

0 comments on commit 49d9d77

Please sign in to comment.