From dcb070e6388ed48367110bd7063db78622864106 Mon Sep 17 00:00:00 2001 From: Steven Syrek Date: Mon, 27 Apr 2026 10:27:38 +0200 Subject: [PATCH] chore(jest): declare types: ['node', 'jest'] for ts-jest under TS 6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TypeScript 6.0 stopped automatically including all @types/* packages globally when the `types` compiler option is unset. Jest globals (beforeAll, afterEach, afterAll, etc.) used in tests/setup.ts and throughout the test suite stopped resolving: tests/setup.ts:10:1 - error TS2304: Cannot find name 'afterEach'. tests/setup.ts:28:1 - error TS2304: Cannot find name 'afterAll'. The main tsconfig.json doesn't need this change because the build only covers src/ (which uses no jest globals) and `skipLibCheck: true` already mutes lib-level surprises. The fix lives in jest.config.js's inline ts-jest tsconfig — both the .ts and .js transformers — because that's what compiles the test files. Verified on both currently-pinned TS 5.9.3 and the proposed TS 6.0.2 (via `--no-save` install): \`npm run lint\` clean, \`npm run type-check\` clean, \`npm test\` 5490 / 5490 tests pass on each. Unblocks dependabot PR #34 (typescript 5.9.3 → 6.0.2) — pairs with the earlier #48 (rootDir) fix to complete TS 6.0 compatibility. Co-Authored-By: Claude Opus 4.7 (1M context) --- jest.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jest.config.js b/jest.config.js index 6a3bbf4..b05563c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -57,6 +57,9 @@ export default { strict: true, esModuleInterop: true, skipLibCheck: true, + // TypeScript 6.0 stopped auto-including all @types/* packages globally; + // declare the ones the test suite needs (jest globals + node). + types: ['node', 'jest'], }, }], '^.+\\.jsx?$': ['ts-jest', { @@ -65,6 +68,7 @@ export default { esModuleInterop: true, skipLibCheck: true, allowJs: true, + types: ['node', 'jest'], }, }], },