Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/bin/run.js b/bin/run.js
index 09056db..ee986d4 100755
--- a/bin/run.js
+++ b/bin/run.js
@@ -251,15 +251,28 @@ const nycReporter = options =>
const runNyc = (cmd, programArgs, options, spawnOpts) => {
const reporter = nycReporter(options)
+ const branches = Math.max(+options.branches || 100, 100)
+ const lines = Math.max(+options.lines || 100, 100)
+ const functions = Math.max(+options.functions || 100, 100)
+ const statements = Math.max(+options.statements || 100, 100)
+
const args = [
nycBin,
...cmd,
...(options['show-process-tree'] ? ['--show-process-tree'] : []),
'--cache=true',
- '--branches=' + options.branches,
+ '--branches=' + branches,
+ '--watermarks.branches=' + branches,
+ '--watermarks.branches=' + (branches + (100 - branches)/2),
'--functions=' + options.functions,
+ '--watermarks.functions=' + functions,
+ '--watermarks.functions=' + (functions + (100 - functions)/2),
'--lines=' + options.lines,
+ '--watermarks.lines=' + lines,
+ '--watermarks.lines=' + (lines + (100 - lines)/2),
'--statements=' + options.statements,
+ '--watermarks.statements=' + statements,
+ '--watermarks.statements=' + (statements + (100 - statements)/2),
...reporter,
'--extension=.js',
'--extension=.jsx',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.