From ef8422c734be4f14ccc8807d200b6b1fbcdbe435 Mon Sep 17 00:00:00 2001 From: Gil Tayar Date: Fri, 10 Jan 2020 12:32:14 +0200 Subject: [PATCH] code review adjustments --- lib/cli/cli.js | 8 +++----- lib/cli/run.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/cli/cli.js b/lib/cli/cli.js index dc0ace7752..dee8e70dd4 100755 --- a/lib/cli/cli.js +++ b/lib/cli/cli.js @@ -12,12 +12,12 @@ */ const debug = require('debug')('mocha:cli:cli'); +const symbols = require('log-symbols'); const yargs = require('yargs/yargs'); const path = require('path'); -const ansi = require('ansi-colors'); -const symbols = require('log-symbols'); const {loadOptions, YARGS_PARSER_CONFIG} = require('./options'); const commands = require('./commands'); +const ansi = require('ansi-colors'); const {repository, homepage, version, gitter} = require('../../package.json'); /** @@ -48,9 +48,7 @@ exports.main = (argv = process.argv.slice(2)) => { .fail((msg, err, yargs) => { debug(err); yargs.showHelp(); - console.error( - `\n${symbols.error} ${ansi.red('ERROR:')} ${err ? err.message : msg}` - ); + console.error(`\n${symbols.error} ${ansi.red('ERROR:')} ${msg}`); process.exit(1); }) .help('help', 'Show usage information & exit') diff --git a/lib/cli/run.js b/lib/cli/run.js index 4b59a13ecd..9c9911131d 100644 --- a/lib/cli/run.js +++ b/lib/cli/run.js @@ -87,7 +87,7 @@ exports.builder = yargs => }, extension: { default: defaults.extension, - defaultDescription: 'js,cjs,mjs', + defaultDescription: 'js', description: 'File extension(s) to load', group: GROUPS.FILES, requiresArg: true, diff --git a/package.json b/package.json index e9f1032e55..8cad374e94 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "growl": "1.10.5", "he": "1.2.0", "js-yaml": "3.13.1", - "log-symbols": "^3.0.0", + "log-symbols": "3.0.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", "ms": "2.1.1",