From b5b67de5155fd8347ff56529cba28b7a9a1744f6 Mon Sep 17 00:00:00 2001 From: Jason Kurian Date: Mon, 6 May 2019 16:39:21 -0400 Subject: [PATCH] fix(check-coverage): make the --temp-dir option visible (#1101) tests: move the reset-state helper to the helpers --- lib/commands/check-coverage.js | 10 ++++++++++ test/{lib => helpers}/reset-state.js | 0 test/nyc-index.js | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) rename test/{lib => helpers}/reset-state.js (100%) diff --git a/lib/commands/check-coverage.js b/lib/commands/check-coverage.js index 8eb36eb50..6b12341b7 100644 --- a/lib/commands/check-coverage.js +++ b/lib/commands/check-coverage.js @@ -51,6 +51,16 @@ exports.builder = function (yargs) { default: false, description: 'check thresholds per file' }) + .option('temp-dir', { + alias: 't', + describe: 'directory to read raw coverage information from', + default: './.nyc_output', + global: false + }) + .option('temp-directory', { + hidden: true, + global: false + }) .example('$0 check-coverage --lines 95', "check whether the JSON in nyc's output folder meets the thresholds provided") } diff --git a/test/lib/reset-state.js b/test/helpers/reset-state.js similarity index 100% rename from test/lib/reset-state.js rename to test/helpers/reset-state.js diff --git a/test/nyc-index.js b/test/nyc-index.js index f7b549e3b..2b7fb1805 100644 --- a/test/nyc-index.js +++ b/test/nyc-index.js @@ -17,7 +17,7 @@ const isWindows = require('is-windows')() const spawn = require('child_process').spawn const fixtures = path.resolve(__dirname, './fixtures') const bin = path.resolve(__dirname, '../self-coverage/bin/nyc') -const resetState = require('./lib/reset-state') +const resetState = require('./helpers/reset-state') require('chai').should() require('tap').mochaGlobals()