Skip to content

test_runner: propagate --experimental-config-file to child processes #59047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 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
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 @@ function parseCommandLine() {
}

const isTestRunner = getOptionValue('--test');
const coverage = getOptionValue('--experimental-test-coverage');
const coverage = getOptionValue('--experimental-test-coverage') &&
!process.env.NODE_TEST_CONTEXT;
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