From 0fc217edb6a583e2015616158fc6e72cf7f46487 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Tue, 5 Mar 2019 22:03:15 -0500 Subject: [PATCH] feat: Add test-exclude args to check-coverage and report subcommands. --- lib/commands/check-coverage.js | 19 +++++++++++++++++++ lib/commands/report.js | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/lib/commands/check-coverage.js b/lib/commands/check-coverage.js index 746c347f2..c302ee916 100644 --- a/lib/commands/check-coverage.js +++ b/lib/commands/check-coverage.js @@ -1,3 +1,4 @@ +const testExclude = require('test-exclude') const NYC = require('../../index.js') exports.command = 'check-coverage' @@ -6,6 +7,24 @@ exports.describe = 'check whether coverage is within thresholds provided' exports.builder = function (yargs) { yargs + .option('exclude', { + alias: 'x', + default: testExclude.defaultExclude, + describe: 'a list of specific files and directories that should be excluded from coverage, glob patterns are supported, node_modules is always excluded', + global: false + }) + .option('exclude-after-remap', { + default: true, + type: 'boolean', + description: 'should exclude logic be performed after the source-map remaps filenames?', + global: false + }) + .option('include', { + alias: 'n', + default: [], + describe: 'a list of specific files that should be covered, glob patterns are supported', + global: false + }) .option('branches', { default: 0, description: 'what % of branches must be covered?' diff --git a/lib/commands/report.js b/lib/commands/report.js index 410058c63..8dfc0f4ab 100644 --- a/lib/commands/report.js +++ b/lib/commands/report.js @@ -1,3 +1,4 @@ +const testExclude = require('test-exclude') const NYC = require('../../index.js') exports.command = 'report' @@ -23,6 +24,24 @@ exports.builder = function (yargs) { .option('temp-directory', { hidden: true }) + .option('exclude', { + alias: 'x', + default: testExclude.defaultExclude, + describe: 'a list of specific files and directories that should be excluded from coverage, glob patterns are supported, node_modules is always excluded', + global: false + }) + .option('exclude-after-remap', { + default: true, + type: 'boolean', + description: 'should exclude logic be performed after the source-map remaps filenames?', + global: false + }) + .option('include', { + alias: 'n', + default: [], + describe: 'a list of specific files that should be covered, glob patterns are supported', + global: false + }) .option('show-process-tree', { describe: 'display the tree of spawned processes', default: false,