diff --git a/cmds/coverage.js b/cmds/coverage.js index 08e194067..ba5762fb7 100644 --- a/cmds/coverage.js +++ b/cmds/coverage.js @@ -42,6 +42,10 @@ module.exports = { describe: 'Do not include passed in files in the coverage report', type: 'array', default: [] + }, + exit: { + describe: 'force shutdown of the event loop after test run: mocha will call process.exit', + default: true } }, handler (argv) { diff --git a/cmds/release.js b/cmds/release.js index d5c46b7d4..af3937e7b 100644 --- a/cmds/release.js +++ b/cmds/release.js @@ -66,6 +66,10 @@ module.exports = { describe: 'Custom globs for files to test', type: 'array', default: [] + }, + exit: { + describe: 'force shutdown of the event loop after test run: mocha will call process.exit', + default: true } }, handler (argv) { diff --git a/cmds/test.js b/cmds/test.js index 025544e45..e72a36bc7 100644 --- a/cmds/test.js +++ b/cmds/test.js @@ -42,6 +42,10 @@ module.exports = { describe: 'The default time a single test has to run', type: 'number', default: 5000 + }, + exit: { + describe: 'force shutdown of the event loop after test run: mocha will call process.exit', + default: true } }, handler (argv) { diff --git a/src/test/node.js b/src/test/node.js index 8f61743a2..ee57a67d5 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -41,6 +41,10 @@ function testNode (ctx) { args.push('--watch') } + if (ctx.exit) { + args.push('--exit') + } + if (ctx.coverage) { exec = 'nyc' args = [