From f41c2cf17c58c1e8fb555696012b26d3603dbf64 Mon Sep 17 00:00:00 2001 From: Lily Shen <115414357+lilyshen0722@users.noreply.github.com> Date: Sat, 31 Oct 2026 01:03:04 -0700 Subject: [PATCH 1/2] test(scripts): stop the DEP0040 punycode warning failing the token-copy tests (TASK-665) The CLI child prints a punycode DeprecationWarning on some runners. The tests assert the child's stderr exactly, so the line failed them and dropped queued PRs. Pass --no-deprecation to the child only. Every fail-closed assertion on the secret-echo path stays exactly as it was. Tests only; no workflow change. Co-Authored-By: Claude Haiku 5.5 Co-authored-by: wisp Agent-Model: claude/claude-haiku-5-5/default --- backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js | 2 +- backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js b/backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js index 2c08f5da1..b9786aa0e 100644 --- a/backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js +++ b/backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js @@ -181,7 +181,7 @@ describe('migrate CLI failure output', () => { ...args, ], { cwd: path.resolve(__dirname, '../../..'), - env: { ...process.env, MONGO_URI: secretUri }, + env: { ...process.env, MONGO_URI: secretUri, NODE_OPTIONS: '--no-deprecation' }, encoding: 'utf8', timeout: 30000, }); diff --git a/backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js b/backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js index f9f127193..112031a62 100644 --- a/backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js +++ b/backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js @@ -79,7 +79,7 @@ describe('scrub legacy feed token copies', () => { ...args, ], { cwd: path.resolve(__dirname, '../../..'), - env: { ...process.env, MONGO_URI: uri }, + env: { ...process.env, MONGO_URI: uri, NODE_OPTIONS: '--no-deprecation' }, encoding: 'utf8', timeout: 15000, }); @@ -127,7 +127,7 @@ describe('scrub CLI failure output', () => { ...args, ], { cwd: path.resolve(__dirname, '../../..'), - env: { ...process.env, MONGO_URI: secretUri }, + env: { ...process.env, MONGO_URI: secretUri, NODE_OPTIONS: '--no-deprecation' }, encoding: 'utf8', timeout: 15000, }); From 256b9b064849c7e8fc761676979d3adfd9898634 Mon Sep 17 00:00:00 2001 From: Lily Shen <115414357+lilyshen0722@users.noreply.github.com> Date: Sat, 31 Oct 2026 01:09:53 -0700 Subject: [PATCH 2/2] test(scripts): keep inherited NODE_OPTIONS when silencing DEP0040 (TASK-665) Setting NODE_OPTIONS replaced any value the test run inherited. Append --no-deprecation to the inherited value instead. Co-Authored-By: Claude Haiku 5.5 Co-authored-by: wisp Agent-Model: claude/claude-haiku-5-5/default --- backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js | 2 +- backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js b/backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js index b9786aa0e..d6b7e3026 100644 --- a/backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js +++ b/backend/__tests__/unit/scripts/migrateChatTokenCopies.test.js @@ -181,7 +181,7 @@ describe('migrate CLI failure output', () => { ...args, ], { cwd: path.resolve(__dirname, '../../..'), - env: { ...process.env, MONGO_URI: secretUri, NODE_OPTIONS: '--no-deprecation' }, + env: { ...process.env, MONGO_URI: secretUri, NODE_OPTIONS: [process.env.NODE_OPTIONS, '--no-deprecation'].filter(Boolean).join(' ') }, encoding: 'utf8', timeout: 30000, }); diff --git a/backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js b/backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js index 112031a62..b11c99031 100644 --- a/backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js +++ b/backend/__tests__/unit/scripts/scrubFeedTokenCopies.test.js @@ -79,7 +79,7 @@ describe('scrub legacy feed token copies', () => { ...args, ], { cwd: path.resolve(__dirname, '../../..'), - env: { ...process.env, MONGO_URI: uri, NODE_OPTIONS: '--no-deprecation' }, + env: { ...process.env, MONGO_URI: uri, NODE_OPTIONS: [process.env.NODE_OPTIONS, '--no-deprecation'].filter(Boolean).join(' ') }, encoding: 'utf8', timeout: 15000, }); @@ -127,7 +127,7 @@ describe('scrub CLI failure output', () => { ...args, ], { cwd: path.resolve(__dirname, '../../..'), - env: { ...process.env, MONGO_URI: secretUri, NODE_OPTIONS: '--no-deprecation' }, + env: { ...process.env, MONGO_URI: secretUri, NODE_OPTIONS: [process.env.NODE_OPTIONS, '--no-deprecation'].filter(Boolean).join(' ') }, encoding: 'utf8', timeout: 15000, });