How to use the @istanbuljs/load-nyc-config.loadNycConfig function in @istanbuljs/load-nyc-config

To help you get started, we’ve selected a few @istanbuljs/load-nyc-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github istanbuljs / nyc / lib / config-util.js View on Github external
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,

@istanbuljs/load-nyc-config

Utility function to load nyc configuration

ISC
Latest version published 4 years ago

Package Health Score

68 / 100
Full package analysis

Popular @istanbuljs/load-nyc-config functions

Similar packages