Using `--test` causes process.argv[] to lose user-specified CLI flags
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.3k
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 283
説明
Version
v25.6.1
Platform
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
Subsystem
node:test
What steps will reproduce the bug?
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.
How often does it reproduce? Is there a required condition?
Consistent.
What is the expected behavior? Why is that the expected behavior?
process.argv should include the user-provided CLI flag in both cases.
What do you see instead?
When running with --test, process.argv omits the user-supplied --hello flag.
This makes testing code that depends on process.argv problematic, obviously.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
foo.js の再現から始め、node foo.js --hello を実行した場合と node --test foo.js --hello を実行した場合の process.argv を比較します。node:test がスクリプト引数をどのように処理するかを追跡し、次に --hello が process.argv に残ることを示すリグレッションテストを追加して、関連する test-runner のテストを実行します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, node.js
- 領域
- testing
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 58/100