Repository navigation
Closed
9 / 99 of 9 issues completedClosed
9 / 99 of 9 issues completed
Copy link
Labels
wayfinder:mapWayfinder map
Description
Destination
A spec issue, with child implementation tickets on a spec/<n>-… branch, for replacing Jest and Babel with Vitest and converting the tests to TypeScript. The map settles decisions; the spec and its tickets do the swap.
Done for the spec means:
- Every file Jest runs today (62 under
src/, 4e2e/helpers/*.test.js) and thejest/support files are TypeScript and run under Vitest, with the same tests passing as under Jest. package.jsonhas nojest,babel-jestor direct@babel/*entry (including theresolutionspin), and thejest/Babel transform is gone.- Converted tests meet the bar of other
.tsundersrc: zero diagnostics under--noImplicitAny, nothing added toscripts/typecheck-baseline.txt. - CI's
yarn react-testruns Vitest.
Notes
- Domain: the test toolchain of an electron-vite app (Vite 8, electron-vite 6, Node 22, Yarn 1). Babel exists only for Jest (
jest/babelTransform.js). - Read
docs/agents/checks.md(Jest setup, test seams, typecheck baseline) anddocs/agents/typescript-leaves.mdbefore a ticket that touches them. - Skills:
grillinganddomain-modelingfor grilling tickets;researchfor research tickets. - Dependencies: add only
vitestand what it strictly requires (for examplejsdomas a direct dependency). Any other new package needs its own decision. - The spike task runs on a throwaway branch that is never merged.
Decisions so far
- Which Vitest version fits this toolchain, and what replaces each Jest feature the suite uses:
vitest@^5.1.1plusjsdom@^29.1.1(jsdom 30+ needs Node 22.22.2); a rootvitest.config.*is required, Vitest cannot readelectron.vite.config.js;jest.fn/spyOn/restoreAllMocksrename tovi.*, whilejest.mock+requireandjest.isolateModulesbecomevi.mock+importandvi.resetModules()+await import(); aliases do not reachrequireornode_modules. - Vitest globals or explicit imports in every test file: explicit
import { … } from 'vitest'in every test and setup file,globalsoff;tscis the only guard against ambient use. - jsdom for every test, or a Node environment for main-process and shell-config tests: jsdom and one setup list for every test, in a single config; no projects or per-file environments.
- Where the test support files and the e2e helper tests live, and how they get typechecked: support files move to
src/test/andjest/is deleted; the 4 e2e helper tests stay ine2e/helpers/with one tsconfig include and a wider baseline second pass; the config is a rootvitest.config.js. - What replaces the react-app/jest lint preset: nothing; the preset is removed with no Vitest lint plugin, and five
testing-librarydisable comments are deleted. - Run the unchanged suite under Vitest on a throwaway branch and record what fails: 57 of 66 files pass unchanged; three causes fail the other 9 (JSX in
.js,jest.isolateModules,jest.mock+require), and with those fixed all 471 tests pass on branch287-vitest-spike. - How typed tests build the renderer bridge stub and mock functions without any: one helper in
src/test/takesPartial<RendererBridge>and holds the only cast; mocks are plainvi.fn(); store stand-ins cast at the site; no@ts-nocheckor@ts-ignore. - Cutover order: swap the runner first or convert per file, one cutover or two runners: one swap ticket moves all tests to Vitest as JavaScript and removes Jest and Babel; conversion tickets follow, support files and bridge helper first; the config is
vitest.config.mjs. - How the test files group into conversion tickets after the swap: ten conversion tickets grouped by what the tests need (about 1,200 lines each at most) plus a closing ticket; support files first, main-process and shell-config in parallel; the swap ticket carries a checklist for the local agent docs.
Not yet specified
Nothing. Every decision ticket is closed and the route is clear. The next step is writing the spec from the decisions above.
Out of scope
- Replacing
eslint-config-react-appand the Babel it pulls in transitively: a separate lint effort. Vitest lint rules go with it. - Converting the Playwright specs, Playwright configs and non-test e2e helpers: a different runner.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 9 sub-issues
Metadata
Metadata
Assignees
Labels
wayfinder:mapWayfinder map
Activity
jtklein-agents commentedon Nov 22, 2026
Done: spec #295 merged upstream in AntonelliLab#509. All map tickets #286–#294 are closed.