From 2699a77a43cab2b18a0366253aec0f30f5ac430c Mon Sep 17 00:00:00 2001 From: Steven Syrek Date: Wed, 29 Jul 2026 14:48:04 -0400 Subject: [PATCH] test(e2e): isolate sync option-routing children from ambient NODE_OPTIONS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 ': 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 --- tests/e2e/cli-sync-option-routing.e2e.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/e2e/cli-sync-option-routing.e2e.test.ts b/tests/e2e/cli-sync-option-routing.e2e.test.ts index 2d6927d..6987759 100644 --- a/tests/e2e/cli-sync-option-routing.e2e.test.ts +++ b/tests/e2e/cli-sync-option-routing.e2e.test.ts @@ -78,6 +78,10 @@ describe('CLI sync option routing E2E', () => { DEEPL_API_KEY: 'mock-api-key-for-testing:fx', NO_COLOR: '1', CI: undefined, + // Ambient NODE_OPTIONS can make node print warnings to stderr, which + // the JSON-envelope assertions parse. + NODE_OPTIONS: undefined, + NODE_NO_WARNINGS: '1', }, stdio: ['ignore', 'pipe', 'pipe'], timeout: 15000,