The issue clearly demonstrates a discrepancy in process.argv handling when using --test flag.
The problem involves process.argv not including user-specified CLI flags when --test is used. The fix likely requires modifying how the test runner processes arguments. No major blockers are apparent from the description.
v25.6.1
Darwin MacBookPro.lan 25.0.0 Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:45 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6000 arm64
node:test
Create a file, "foo.js":
console.log(process.argv);
... then invoke node with a custom CLI flag (--hello), and both with and without the --test flag:
# Run script with a custom CLI flag (without --test):
$ node foo.js --hello
[
'/Users/kieffer/.nvm/versions/node/v25.6.1/bin/node',
'/Users/kieffer/codepen/codewatch/packages/foo.js',
'--hello'
]
# ... now add `--test`:
$ node --test foo.js --hello
[
'/Users/kieffer/.nvm/versions/node/v25.6.1/bin/node',
'/Users/kieffer/codepen/codewatch/packages/foo.js'
]
✔ foo.js (35.9505ms)
<snip>
[!NOTE] Running with the "--" flag (e.g.
node foo.js -- --helloornode --test foo.js -- --hello) yields the same behavior.
Consistent.
process.argv should include the user-provided CLI flag in both cases.
When running with --test, process.argv omits the user-supplied --hello flag.
This makes testing code that depends on process.argv problematic, obviously.
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!