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

feat: bump yargs to 17 #5165

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
6 changes: 3 additions & 3 deletions lib/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

const debug = require('debug')('mocha:cli:cli');
const symbols = require('log-symbols');
const yargs = require('yargs/yargs');
const yargs = require('yargs');
const path = require('path');
const {
loadRc,
Expand Down Expand Up @@ -59,15 +59,15 @@ exports.main = (argv = process.argv.slice(2), mochaArgs) => {
debug('caught error sometime before command handler: %O', err);
yargs.showHelp();
console.error(`\n${symbols.error} ${ansi.red('ERROR:')} ${msg}`);
process.exitCode = 1;
process.exit(1);
})
.help('help', 'Show usage information & exit')
.alias('help', 'h')
.version('version', 'Show version number & exit', version)
.alias('version', 'V')
.wrap(process.stdout.columns ? Math.min(process.stdout.columns, 80) : 80)
.epilog(
`Mocha Resources
`${ansi.reset("Mocha Resources")}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This epilog(ue) wasn't being printed before. Now it is. On error, everything is red, so this ansi.reset is needed to make the colors actually show through.

Chat: ${ansi.magenta(discord)}
GitHub: ${ansi.blue(repository.url)}
Docs: ${ansi.yellow(homepage)}
Expand Down
4 changes: 3 additions & 1 deletion lib/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ function Mocha(options = {}) {
.ui(options.ui)
.reporter(
options.reporter,
options.reporterOption || options.reporterOptions // for backwards compatibility
options['reporter-option'] ||
options.reporterOption ||
options.reporterOptions // for backwards compatibility
)
.slow(options.slow)
.global(options.global);
Expand Down
Loading
Loading