From e40ba3721da96d397736486ba7815d0cc57d8a09 Mon Sep 17 00:00:00 2001 From: quality Date: Tue, 29 Sep 2026 22:35:50 -0400 Subject: [PATCH] test(bundle): opt the node --check spawn out of NODE_V8_COVERAGE Node re-injects the parent's NODE_V8_COVERAGE into any child whose env lacks the key, and `node --check dist/index.js` aborts under it on Node 26 (WeakRef: invalid target in the source-map cache). Once vitest runs with coverage.autoAttachSubprocess the worker carries that variable and the bundle validity test fails. Pass an explicit empty value so the syntax check runs without coverage. Signed-off-by: quality --- __tests__/bundle/bundle.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/__tests__/bundle/bundle.test.ts b/__tests__/bundle/bundle.test.ts index 7babb3a..3eb2e63 100644 --- a/__tests__/bundle/bundle.test.ts +++ b/__tests__/bundle/bundle.test.ts @@ -138,7 +138,10 @@ describe('dist/index.js', () => { it('is a syntactically valid bundle with no unresolved modules', () => { expect(fs.existsSync(bundlePath)).toBe(true) - const check = spawnSync(process.execPath, ['--check', bundlePath], { encoding: 'utf8' }) + // node re-injects the parent's NODE_V8_COVERAGE into any child env lacking the key, and + // `node --check` crashes under it (nodejs v26 source-map cache); an empty value opts out + const env = { ...process.env, NODE_V8_COVERAGE: '' } + const check = spawnSync(process.execPath, ['--check', bundlePath], { encoding: 'utf8', env }) expect(check.status, check.stderr).toBe(0) expect(fs.readFileSync(bundlePath, 'utf8')).not.toContain('webpackMissingModule')