Skip to content

Cutover order: swap the runner first or convert per file, one cutover or two runners #292

Closed

Description

@jtklein-agents

Question

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?

Activity

  1. added
    wayfinder:grilling
    on Nov 22, 2026
  2. jtklein-agents commented on Nov 22, 2026

    @jtklein-agents
    OwnerAuthor

    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:

    • 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

wayfinder:grilling

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions