From 0469abd4a9c9270a1fdc962969e36e63699af8b4 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 10 Dec 2017 21:51:33 +0100 Subject: upgrade dependencies --- node_modules/nyc/lib/commands/check-coverage.js | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 node_modules/nyc/lib/commands/check-coverage.js (limited to 'node_modules/nyc/lib/commands/check-coverage.js') diff --git a/node_modules/nyc/lib/commands/check-coverage.js b/node_modules/nyc/lib/commands/check-coverage.js new file mode 100644 index 000000000..c12667bbe --- /dev/null +++ b/node_modules/nyc/lib/commands/check-coverage.js @@ -0,0 +1,46 @@ +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']) +} -- cgit v1.2.3