diff --git a/lib/cli/cli.js b/lib/cli/cli.js index c17d68a99d..b51c2a1973 100755 --- a/lib/cli/cli.js +++ b/lib/cli/cli.js @@ -11,7 +11,7 @@ const debug = require('debug')('mocha:cli:cli'); const symbols = require('log-symbols'); -const yargs = require('yargs'); +const yargs = require('yargs/yargs'); const path = require('path'); const {loadOptions, YARGS_PARSER_CONFIG} = require('./options'); const commands = require('./commands'); @@ -32,7 +32,7 @@ exports.main = (argv = process.argv.slice(2)) => { Error.stackTraceLimit = Infinity; // configurable via --stack-trace-limit? - yargs + yargs() .scriptName('mocha') .command(commands.run) .command(commands.init) diff --git a/test/node-unit/cli/run.spec.js b/test/node-unit/cli/run.spec.js index 6dfe5aaa4f..ed93b09129 100644 --- a/test/node-unit/cli/run.spec.js +++ b/test/node-unit/cli/run.spec.js @@ -7,7 +7,7 @@ describe('command', function() { describe('run', function() { describe('builder', function() { const IGNORED_OPTIONS = new Set(['help', 'version']); - const options = builder(require('yargs')).getOptions(); + const options = builder(require('yargs/yargs')().reset()).getOptions(); ['number', 'string', 'boolean', 'array'].forEach(type => { describe(`${type} type`, function() { Array.from(new Set(options[type])).forEach(option => {