diff --git a/cmds/test.js b/cmds/test.js index 8b157ab39..b4c0e1c4b 100644 --- a/cmds/test.js +++ b/cmds/test.js @@ -19,6 +19,11 @@ module.exports = { 'Debug electron renderer test with a persistent window.' ) .options({ + '100': { + describe: 'Check coverage and validate 100% was covered.', + type: 'boolean', + default: false + }, target: { alias: 't', describe: 'In which target environment to execute the tests', diff --git a/src/test/node.js b/src/test/node.js index d7a8c5584..60512e25b 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -62,6 +62,18 @@ function testNode (ctx) { let err + if (ctx['100']) { + args = [ + '--check-coverage', + '--branches=100', + '--functions=100', + '--lines=100', + '--statements=100', + exec + ].concat(args) + exec = 'nyc' + } + return preHook(ctx).then(() => { return execa(exec, args.concat(files.map((p) => path.normalize(p))), { env: env,