diff options
Diffstat (limited to 'node_modules/nyc/lib/commands')
-rw-r--r-- | node_modules/nyc/lib/commands/check-coverage.js | 46 | ||||
-rw-r--r-- | node_modules/nyc/lib/commands/instrument.js | 82 | ||||
-rw-r--r-- | node_modules/nyc/lib/commands/report.js | 45 |
3 files changed, 0 insertions, 173 deletions
diff --git a/node_modules/nyc/lib/commands/check-coverage.js b/node_modules/nyc/lib/commands/check-coverage.js deleted file mode 100644 index c12667bbe..000000000 --- a/node_modules/nyc/lib/commands/check-coverage.js +++ /dev/null @@ -1,46 +0,0 @@ -var NYC -try { - NYC = require('../../index.covered.js') -} catch (e) { - NYC = require('../../index.js') -} - -exports.command = 'check-coverage' - -exports.describe = 'check whether coverage is within thresholds provided' - -exports.builder = function (yargs) { - yargs - .option('branches', { - default: 0, - description: 'what % of branches must be covered?' - }) - .option('functions', { - default: 0, - description: 'what % of functions must be covered?' - }) - .option('lines', { - default: 90, - description: 'what % of lines must be covered?' - }) - .option('statements', { - default: 0, - description: 'what % of statements must be covered?' - }) - .option('per-file', { - default: false, - description: 'check thresholds per file' - }) - .example('$0 check-coverage --lines 95', "check whether the JSON in nyc's output folder meets the thresholds provided") -} - -exports.handler = function (argv) { - process.env.NYC_CWD = process.cwd() - - ;(new NYC(argv)).checkCoverage({ - lines: argv.lines, - functions: argv.functions, - branches: argv.branches, - statements: argv.statements - }, argv['per-file']) -} diff --git a/node_modules/nyc/lib/commands/instrument.js b/node_modules/nyc/lib/commands/instrument.js deleted file mode 100644 index b24c0bb56..000000000 --- a/node_modules/nyc/lib/commands/instrument.js +++ /dev/null @@ -1,82 +0,0 @@ -var NYC -try { - NYC = require('../../index.covered.js') -} catch (e) { - NYC = require('../../index.js') -} - -exports.command = 'instrument <input> [output]' - -exports.describe = 'instruments a file or a directory tree and writes the instrumented code to the desired output location' - -exports.builder = function (yargs) { - return yargs - .option('require', { - alias: 'i', - default: [], - describe: 'a list of additional modules that nyc should attempt to require in its subprocess, e.g., babel-register, babel-polyfill.' - }) - .option('extension', { - alias: 'e', - default: [], - describe: 'a list of extensions that nyc should handle in addition to .js' - }) - .option('source-map', { - default: true, - type: 'boolean', - description: 'should nyc detect and handle source maps?' - }) - .option('produce-source-map', { - default: false, - type: 'boolean', - description: "should nyc's instrumenter produce source maps?" - }) - .option('compact', { - default: true, - type: 'boolean', - description: 'should the output be compacted?' - }) - .option('preserve-comments', { - default: true, - type: 'boolean', - description: 'should comments be preserved in the output?' - }) - .option('instrument', { - default: true, - type: 'boolean', - description: 'should nyc handle instrumentation?' - }) - .option('exit-on-error', { - default: false, - type: 'boolean', - description: 'should nyc exit when an instrumentation failure occurs?' - }) - .example('$0 instrument ./lib ./output', 'instrument all .js files in ./lib with coverage and output in ./output') -} - -exports.handler = function (argv) { - // if instrument is set to false, - // enable a noop instrumenter. - if (!argv.instrument) argv.instrumenter = './lib/instrumenters/noop' - else argv.instrumenter = './lib/instrumenters/istanbul' - - var nyc = new NYC({ - instrumenter: argv.instrumenter, - sourceMap: argv.sourceMap, - produceSourceMap: argv.produceSourceMap, - extension: argv.extension, - require: argv.require, - compact: argv.compact, - preserveComments: argv.preserveComments, - exitOnError: argv.exitOnError - }) - - nyc.instrumentAllFiles(argv.input, argv.output, function (err) { - if (err) { - console.error(err.message) - process.exit(1) - } else { - process.exit(0) - } - }) -} diff --git a/node_modules/nyc/lib/commands/report.js b/node_modules/nyc/lib/commands/report.js deleted file mode 100644 index ff89da3f8..000000000 --- a/node_modules/nyc/lib/commands/report.js +++ /dev/null @@ -1,45 +0,0 @@ -var NYC -try { - NYC = require('../../index.covered.js') -} catch (e) { - NYC = require('../../index.js') -} - -exports.command = 'report' - -exports.describe = 'run coverage report for .nyc_output' - -exports.builder = function (yargs) { - return yargs - .option('reporter', { - alias: 'r', - describe: 'coverage reporter(s) to use', - default: 'text' - }) - .option('report-dir', { - describe: 'directory to output coverage reports in', - default: 'coverage' - }) - .option('temp-directory', { - describe: 'directory to read raw coverage information from', - default: './.nyc_output' - }) - .option('show-process-tree', { - describe: 'display the tree of spawned processes', - default: false, - type: 'boolean' - }) - .option('skip-empty', { - describe: 'don\'t show empty files (no lines of code) in report', - default: false, - type: 'boolean', - global: false - }) - .example('$0 report --reporter=lcov', 'output an HTML lcov report to ./coverage') -} - -exports.handler = function (argv) { - process.env.NYC_CWD = process.cwd() - var nyc = new NYC(argv) - nyc.report() -} |