Skip to content

Commit 527dd22

Browse files
sjsyrekclaude
andauthored
test(e2e): isolate sync option-routing children from ambient NODE_OPTIONS (#109)
The runCli helper spread process.env into the spawned CLI, so a shell whose NODE_OPTIONS makes node print a startup warning polluted stderr ahead of the JSON error envelope and broke JSON.parse in the --format json assertion. Reproduced with NODE_OPTIONS='--require <emit-warning script>': 1 failed / 19 passed before, 20/20 after. The child now drops NODE_OPTIONS and sets NODE_NO_WARNINGS, matching cli-cache-degraded's handling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 59c4e4a commit 527dd22

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎tests/e2e/cli-sync-option-routing.e2e.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ describe('CLI sync option routing E2E', () => {
7878
DEEPL_API_KEY: 'mock-api-key-for-testing:fx',
7979
NO_COLOR: '1',
8080
CI: undefined,
81+
// Ambient NODE_OPTIONS can make node print warnings to stderr, which
82+
// the JSON-envelope assertions parse.
83+
NODE_OPTIONS: undefined,
84+
NODE_NO_WARNINGS: '1',
8185
},
8286
stdio: ['ignore', 'pipe', 'pipe'],
8387
timeout: 15000,

0 commit comments

Comments
 (0)