Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ const kFilterArgs = [
const kFilterArgValues = [
'--test-reporter',
'--test-reporter-destination',
'--experimental-config-file',
];
const kDiagnosticsFilterArgs = ['tests', 'suites', 'pass', 'fail', 'cancelled', 'skipped', 'todo', 'duration_ms'];

Expand Down Expand Up @@ -389,6 +388,8 @@ function runTestFile(path, filesWatcher, opts) {
if (opts.root.harness.shouldColorizeTestFiles) {
env.FORCE_COLOR = '1';
}
// Prevent coverage reporting in child processes to avoid duplication
env.NODE_TEST_DISABLE_COVERAGE = '1';

const child = spawn(
process.execPath, args,
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/test_runner/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@
}

const isTestRunner = getOptionValue('--test');
const coverage = getOptionValue('--experimental-test-coverage');
const coverage = getOptionValue('--experimental-test-coverage') &&

Check failure on line 199 in lib/internal/test_runner/utils.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Trailing spaces not allowed
!process.env.NODE_TEST_DISABLE_COVERAGE;
Comment thread
MoLow marked this conversation as resolved.
Outdated
const forceExit = getOptionValue('--test-force-exit');
const sourceMaps = getOptionValue('--enable-source-maps');
const updateSnapshots = getOptionValue('--test-update-snapshots');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test } from 'node:test';
import { strictEqual } from 'node:assert';
import internal from 'internal/options';

test('it should not receive --experimental-config-file option', () => {
test('it should receive --experimental-config-file option', () => {
const optionValue = internal.getOptionValue("--experimental-config-file");
strictEqual(optionValue, '');
strictEqual(optionValue, 'node.config.json');
})
2 changes: 1 addition & 1 deletion test/parallel/test-runner-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ for (const isolation of ['none', 'process']) {
}

{
// Should not propagate --experimental-config-file option to sub test in isolation process
// Should propagate --experimental-config-file option to sub test in isolation process
const fixturePath = join(testFixtures, 'options-propagation');
const args = [
'--test-reporter=tap',
Expand Down
Loading