From 4f974701ff45f785f761af3f9c2b13242f980ce4 Mon Sep 17 00:00:00 2001 From: Codebuff Contributor Date: Wed, 20 May 2026 08:28:13 +0600 Subject: [PATCH 1/2] test_runner: print coverage report with dot reporter --- lib/internal/test_runner/reporter/dot.js | 4 ++++ 1 file changed, 4 insertions(+) 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'; From dd377c88156d5b76b38591851f0c0de8878e79fc Mon Sep 17 00:00:00 2001 From: Codebuff Contributor Date: Wed, 20 May 2026 08:37:25 +0600 Subject: [PATCH 2/2] test_runner: do not read from process.argv and process.cwd() in run() --- lib/internal/main/test_runner.js | 5 ++++- lib/internal/test_runner/runner.js | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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/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; }