You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Setting "experimental-test-coverage": true within node.config.json causes multiple reports #58828
Create a node.config.json file and include "experimental-test-coverage": true
in CLI, run node --experimental-config-file='./node.config.json' --test
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
It behaves like passing the CLI flag --experimental-test-coverage.
What do you see instead?
It appears the test coverage "flag" from the config file is getting passed along to the various sub-processes the test runner spawns, and they are each reporting their own set of tests' coverage. And then at the end, the parent process reports the full coverage.
Additional information
Merely moving the test coverage flag from config file to cli (leaving other options in the config file) avoids the issue.
But I believe cp reads from process.env (or whatever that is derived from), which means the filtered out options are resurrected by cp when spawning, effectively ignoring test runner's filtering. So the filtering would instead need to be (conditionally) applied wherever cp is doing this.
Activity
JakobJingleheimer commentedon Jun 25, 2025
Test runner is filtering the options passed to child_process https://github.com/nodejs/node/blob/main/lib/internal/test_runner/runner.js#L101 (thanks @pmarchini for the investigation).
But I believe cp reads from
process.env(or whatever that is derived from), which means the filtered out options are resurrected by cp when spawning, effectively ignoring test runner's filtering. So the filtering would instead need to be (conditionally) applied wherever cp is doing this.I'll try to take a look in the next few days.
marco-ippolito commentedon Jun 25, 2025
can you provide an example of your
node.config.jsonJakobJingleheimer commentedon Jun 25, 2025
Added to the OP (so it doesn't get buried) under a
<details>.