Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
yargs
.example('$0 npm test', 'instrument your tests with coverage')
.example('$0 --require @babel/register npm test', 'instrument your tests with coverage and transpile with Babel')
.example('$0 report --reporter=text-lcov', 'output lcov report after running your tests')
.epilog('visit https://git.io/vHysA for list of available reporters')
.boolean('h')
.boolean('version')
.help(false)
.version(false)
const instrumenterArgs = processArgs.hideInstrumenteeArgs()
// This yargs.parse must come before any options that exit post-hoc
const childArgs = processArgs.hideInstrumenterArgs(yargs.parse(process.argv.slice(2)))
const config = await loadNycConfig(yargs.parse(instrumenterArgs))
yargs
.config(config)
.help('h')
.alias('h', 'help')
.version()
.command(require('./commands/check-coverage'))
.command(require('./commands/instrument'))
.command(require('./commands/report'))
.command(require('./commands/merge'))
return {
get argv () {
return yargs.parse(instrumenterArgs)
},
childArgs,