Migrating from Jest to Vitest: why a written spec mattered even for a mechanical change
A design system team replaced Jest with Vitest, since their Vite-based setup, including Storybook, already ran a separate transform pipeline for tests. Before changing any tests, the author wrote a spec that inventoried the codebase: 68 test files, roughly 120 jest.fn calls, 15 jest.mock calls, and one file using fake timers. The spec also listed non-goals, such as not migrating untested legacy packages and not changing the jsdom environment, and defined done as all tests passing with unchanged assertions and five dependencies removed. The migration took about two days and was delivered as five small commits. The author argues that a clear non-goals list is what keeps a mechanical migration from expanding into a rewrite.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in