Commit 92ae3c2
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
0 commit comments