You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cutover order: swap the runner first or convert per file, one cutover or two runners #292
Does the spec swap the runner on the JavaScript tests first and convert to TypeScript after, or convert each file as it moves to Vitest? Is there one cutover commit, or do Jest and Vitest run side by side for a time, and what does CI run in between?
Swap the runner first, in one cutover, then convert. There is never a two-runner period.
Ticket 1 of the spec: the swap. All 66 test files move to Vitest while still JavaScript, and Jest and Babel are removed in the same ticket. It contains:
vitest and jsdom added; the config file vitest.config.mjs.
jest.* → vi.* and explicit vitest imports in every test and setup file.
The 5 module-loading rewrites the spike proved (vi.resetModules() + await import() in four files; vi.mock + vi.hoisted in src/main/getActiveState.test.js).
The 4 JSX test files renamed to .jsx with no content change.
Support files moved from jest/ to src/test/ still as JavaScript, with path updates. jest/babelTransform.js, jest/fileMock.js and jest.config.js deleted; no jest/ directory remains.
package.json: scripts run Vitest; jest, babel-jest, every @babel/* entry and the resolutions pin removed.
The react-app/jest lint preset and the five testing-library disable comments removed.
The setImmediate polyfill in src/main/updates.test.js deleted.
Why one ticket: tests cannot import from vitest while Jest runs them, and the lint preset cannot go while Jest globals are in use. The spike showed the swap needs real edits in only 9 files.
After the swap: conversion tickets. Each follows the existing leaf rule: a rename commit (git mv, R100), then a typing commit, with the tests passing after each. The first conversion ticket types the support files in src/test/ and adds the bridge helper, because every other converted test depends on it. The four .jsx files become .tsx in their conversion ticket.
Config file name:vitest.config.mjs. This supersedes the .js name in the support-files ticket; the spike found .js prints a Vite warning on every run.
Rejected: converting per file with two runners side by side (both configs split the files, CI runs both, Jest and Babel stay until the last file); converting to TypeScript under Jest first (types written against Jest, then rewritten).
Activity
jtklein-agents commentedon Nov 22, 2026
Resolution
Swap the runner first, in one cutover, then convert. There is never a two-runner period.
Ticket 1 of the spec: the swap. All 66 test files move to Vitest while still JavaScript, and Jest and Babel are removed in the same ticket. It contains:
vitestandjsdomadded; the config filevitest.config.mjs.jest.*→vi.*and explicitvitestimports in every test and setup file.vi.resetModules()+await import()in four files;vi.mock+vi.hoistedinsrc/main/getActiveState.test.js)..jsxwith no content change.jest/tosrc/test/still as JavaScript, with path updates.jest/babelTransform.js,jest/fileMock.jsandjest.config.jsdeleted; nojest/directory remains.package.json: scripts run Vitest;jest,babel-jest, every@babel/*entry and theresolutionspin removed.react-app/jestlint preset and the fivetesting-librarydisable comments removed.setImmediatepolyfill insrc/main/updates.test.jsdeleted.Why one ticket: tests cannot import from
vitestwhile Jest runs them, and the lint preset cannot go while Jest globals are in use. The spike showed the swap needs real edits in only 9 files.After the swap: conversion tickets. Each follows the existing leaf rule: a rename commit (
git mv, R100), then a typing commit, with the tests passing after each. The first conversion ticket types the support files insrc/test/and adds the bridge helper, because every other converted test depends on it. The four.jsxfiles become.tsxin their conversion ticket.Config file name:
vitest.config.mjs. This supersedes the.jsname in the support-files ticket; the spike found.jsprints a Vite warning on every run.Rejected: converting per file with two runners side by side (both configs split the files, CI runs both, Jest and Babel stay until the last file); converting to TypeScript under Jest first (types written against Jest, then rewritten).