diff --git a/lib/internal/main/test_runner.js b/lib/internal/main/test_runner.js index fda47897da9f06..24b020144d24b3 100644 --- a/lib/internal/main/test_runner.js +++ b/lib/internal/main/test_runner.js @@ -30,7 +30,10 @@ if (isUsingInspector() && options.isolation === 'process') { options.inspectPort = process.debugPort; } -options.globPatterns = ArrayPrototypeSlice(process.argv, 1); +const argv = ArrayPrototypeSlice(process.argv, 1); +options.argv = argv; +options.globPatterns = argv; +options.cwd = process.cwd(); debug('test runner configuration:', options); run(options).on('test:summary', (data) => { diff --git a/lib/internal/test_runner/reporter/dot.js b/lib/internal/test_runner/reporter/dot.js index 45ff047bc4e5a0..15645695f1597b 100644 --- a/lib/internal/test_runner/reporter/dot.js +++ b/lib/internal/test_runner/reporter/dot.js @@ -4,6 +4,7 @@ const { MathMax, } = primordials; const colors = require('internal/util/colors'); +const { getCoverageReport } = require('internal/test_runner/utils'); const { formatTestReport } = require('internal/test_runner/reporter/utils'); module.exports = async function* dot(source) { @@ -18,6 +19,9 @@ module.exports = async function* dot(source) { yield `${colors.red}X${colors.reset}`; ArrayPrototypePush(failedTests, data); } + if (type === 'test:coverage') { + yield getCoverageReport('', data.summary, '', '', true); + } if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) { yield '\n'; diff --git a/lib/internal/test_runner/runner.js b/lib/internal/test_runner/runner.js index d6cb6438d2b52a..fd8e0439a331ee 100644 --- a/lib/internal/test_runner/runner.js +++ b/lib/internal/test_runner/runner.js @@ -240,13 +240,12 @@ function getRunArgs(path, { forceExit, if (path === kIsolatedProcessName) { ArrayPrototypePush(runArgs, '--test'); - ArrayPrototypePushApply(runArgs, ArrayPrototypeSlice(process.argv, 1)); + ArrayPrototypePushApply(runArgs, suppliedArgs); } else { ArrayPrototypePush(runArgs, path); + ArrayPrototypePushApply(runArgs, suppliedArgs); } - ArrayPrototypePushApply(runArgs, suppliedArgs); - return runArgs; }