Skip to content

Commit 92ae3c2

Browse files
sjsyrekclaude
andauthored
chore(jest): declare types: ['node', 'jest'] for ts-jest under TS 6.0 (#49)
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) <noreply@anthropic.com>
1 parent 3094032 commit 92ae3c2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ export default {
5757
strict: true,
5858
esModuleInterop: true,
5959
skipLibCheck: true,
60+
// TypeScript 6.0 stopped auto-including all @types/* packages globally;
61+
// declare the ones the test suite needs (jest globals + node).
62+
types: ['node', 'jest'],
6063
},
6164
}],
6265
'^.+\\.jsx?$': ['ts-jest', {
@@ -65,6 +68,7 @@ export default {
6568
esModuleInterop: true,
6669
skipLibCheck: true,
6770
allowJs: true,
71+
types: ['node', 'jest'],
6872
},
6973
}],
7074
},

0 commit comments

Comments
 (0)