Motivation
Now that the production container and CI both run on bun, the test runner is
the last major piece of the toolchain still on Node. Switching to bun test
would give us:
- Meaningfully faster test runs (no TS transform step, native ESM)
- Removal of several devDependencies:
jest, ts-jest, ts-jest-resolver,
@types/jest, jest-junit, cross-env, and the
NODE_OPTIONS=--experimental-vm-modules flag
- Runtime parity — tests execute under the same engine as production
Why not now
The test suite needs focused attention during the migration rather than a
piecemeal swap. Known migration friction:
bun test's Jest-compat layer covers most of expect, mocks, and timers,
but has edge cases around jest.mock, module hoisting, and some matchers
jest-junit has no direct bun equivalent — CI reporting in deploy.yml
(Codecov test-results upload) would need to be re-wired
- The
coverage-summary.json format consumed by deploy-develop.yml's
coverage-report step would need replacing with bun test's coverage
output format
- MSW setup in
tests/setup.ts may need adjustments for bun's module
resolution
Scope
Related
- Follow-up to the bun runtime migration (
bun-experimentation branch)
Motivation
Now that the production container and CI both run on bun, the test runner is
the last major piece of the toolchain still on Node. Switching to
bun testwould give us:
jest,ts-jest,ts-jest-resolver,@types/jest,jest-junit,cross-env, and theNODE_OPTIONS=--experimental-vm-modulesflagWhy not now
The test suite needs focused attention during the migration rather than a
piecemeal swap. Known migration friction:
bun test's Jest-compat layer covers most ofexpect, mocks, and timers,but has edge cases around
jest.mock, module hoisting, and some matchersjest-junithas no direct bun equivalent — CI reporting indeploy.yml(Codecov test-results upload) would need to be re-wired
coverage-summary.jsonformat consumed bydeploy-develop.yml'scoverage-report step would need replacing with
bun test's coverageoutput format
tests/setup.tsmay need adjustments for bun's moduleresolution
Scope
tests/**tobun testAPIs where they diverge from Jestcross-env+NODE_OPTIONSusage inpackage.jsontestscriptdeploy-develop.ymlfor bun'scoverage output
jest-junitreporting indeploy.ymlwith a bun-compatibleequivalent (or drop it if Codecov can consume bun's output directly)
Related
bun-experimentationbranch)