fix(deps): pin typescript to ^6 until ts-jest supports v7 - #418
Closed
cdmren wants to merge 1 commit into
Closed
Conversation
ts-jest 29.4.12 (latest) declares typescript: >=4.3 <7 as a peer dependency, so TypeScript 7 breaks every test suite with "does not expose the JavaScript compiler API required by ts-jest". This has been failing CI on main and every PR rebased onto it since #407 merged despite a red build check (main has no branch protection).
This was referenced Aug 3, 2026
cdmren
added a commit
that referenced
this pull request
Aug 4, 2026
ts-jest (latest 29.4.12) requires typescript <7, which is what's breaking the build check on main and every PR rebased onto it (see #407, #417). This is a third angle on the same fix (alongside #418 and #419): move off Node/yarn/jest entirely in favor of bun, whose built-in test runner transpiles TS itself and has no such constraint, so typescript stays on ^7.0.2. - Replace yarn.lock with bun.lock; drop .nvmrc in favor of .bun-version - Drop jest/ts-jest/@types/jest; add @types/bun for bun:test's types - package.json test script: "bun test" - Test files: swap @jest/globals imports for bun:test's native mock/spyOn, and add explicit beforeEach(() => mock.clearAllMocks()) where mocks carry state across tests, since bun doesn't have jest's resetMocks/vitest's mockReset config equivalent - with-cache.test.ts: expect(async () => {...}).rejects.toThrow() doesn't work under bun (it requires an actual Promise, not a function reference, unlike jest/vitest which auto-invoke); changed to pass the invoked promise directly - CI/example/release workflows: swap actions/setup-node + yarn for oven-sh/setup-bun + bun - .releaserc.yaml: prepareCmd now runs bun instead of yarn Verified locally: bun install, bun test (44/44 across 8 files), and bun run build (tsc + ncc) all pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI Slop
typescriptwas bumped to^7.0.2in #407, but that PR's ownbuildcheckfailed and merged anyway (main has no branch protection). Every PR since —
including #417 — inherits the breakage on rebase.
The cause:
ts-jest@29.4.12(latest) declarestypescript: >=4.3 <7as apeer dependency. TypeScript 7 doesn't expose the compiler API ts-jest needs,
so every test suite fails to even load with:
This pins
typescriptback to^6.0.3(latest stable 6.x) until ts-jestships TS7 support. Verified locally:
yarn buildandyarn testboth pass(8/8 suites, 44/44 tests) after the downgrade.