Skip to content

Successor Map · Testing

Jest to Vitest: a mostly compatible move for Vite projects

Jest is not deprecated and shipped a major version in 2025. Projects built with Vite move to Vitest so that the application and its tests share one configuration and one build pipeline.

Slide: Jest on the left, an arrow, and Vitest on the right.
Status of the old tool
Still active
Effort to move
Mechanical
gen2.dev's view
Leave it
Sources checked
2026-11-28

Key facts

Gen 1Jest
Gen 2Vitest
Kind of toolTesting
Status of Gen 1Still active Jest's own blog announced Jest 30 on June 4, 2025, and its documentation lists 30.5 as the current version (checked November 28, 2026).
Effort to moveMechanical: same ideas, different calls
What breaksGlobals are off by default, mockReset behaves differently, module mock factories must define every export, and callback-style tests are not supported.
Should you move?Leave it Jest is actively developed under the OpenJS Foundation, so the only reason to move is a simpler setup on a Vite project. This is gen2.dev's view, not the maintainers'.
Sources checked2026-11-28, 3 sources

Gen 1 and Gen 2 side by side

npm registry Gen 1 Gen 2
Packagejestvitest
Latest version30.5.25.1.2
Latest releaseSep 18, 2026Nov 25, 2026
First releaseFeb 22, 2012Dec 3, 2021
LicenseMITMIT
Downloads, last week57,533,284177,921,721

Read from each package registry on November 29, 2026. Downloads include automated installs such as build servers, so compare them as a trend, not a head count.

What Gen 1 was

Jest is a JavaScript test runner that bundles the runner, assertions, mocking and snapshots in one package. It was created at Meta. On May 11, 2022 it joined the OpenJS Foundation, a change that in Jest's words "transfers ownership of the project from Meta to the Jest Core team."

It is not a dead tool. Jest 30 was announced on June 4, 2025. The announcement was candid about what came before it: "we admit that three years for a major release is too long." The team said it would aim for more frequent major releases and more consistent release cycles. The current documentation is for version 30.5.

What replaced it

For many teams, nothing has. Where a replacement has happened, it is Vitest, and mostly on projects built with Vite.

Vitest's argument is about duplication. A Vite application tested with Jest has two pipelines that each have to understand the same source files. Vitest's documentation calls that "a duplication of complexity," and offers one configuration for development, build and test. It also claims "compatibility with most of the Jest API and ecosystem libraries."

What moving involves

The API is close enough that most test files change very little. The usual sequence is to swap the configuration, replace the jest object with vi, and work through the failures.

The direct replacements are simple:

  • jest.requireActual becomes vi.importActual.
  • jest.setTimeout becomes vi.setConfig({ testTimeout }).
  • JEST_WORKER_ID has a counterpart called VITEST_POOL_ID.
  • Types come from vitest imports. There is no jest namespace.

What breaks

The Vitest migration guide lists the differences. These are the ones that fail quietly or widely:

  • Globals. "Jest has their globals API enabled by default. Vitest does not." Either enable them in the configuration or import describe, it and expect in every file.
  • mockReset. In Jest it replaces the implementation with an empty function. In Vitest it restores the original implementation. Tests that depended on the empty function will change behavior without an error at the call.
  • Module mocks. A vi.mock factory has to return an object with each export explicitly defined. Jest treated the factory's return value as the default export.
  • The __mocks__ folder. Modules in the root __mocks__ folder are not loaded unless vi.mock() is called.
  • Callback tests. "Vitest does not support the callback style of declaring tests." Tests that take done must become async or return a promise.
  • Legacy timers. Jest's legacy fake timers are not supported.

Should you move?

Staying on Jest is fine. It is maintained, it has a foundation behind it, and it shipped a major version in 2025. Of the four options, leaving a working test setup alone is usually the cheapest.

The exception is a project that already builds with Vite and maintains a second set of transforms only so Jest can read the same files. There the move removes real configuration. A large suite with heavy module mocking should budget time for the mock differences before it commits.

Common questions

Is Jest dead?

No. Its maintainers have not announced an end. Jest's own blog announced Jest 30 on June 4, 2025, and its documentation lists 30.5 as the current version (checked November 28, 2026).

What replaced Jest?

Vitest. Effort to move: Mechanical: same ideas, different calls

Should I move off Jest?

gen2.dev's view: Leave it. Jest is actively developed under the OpenJS Foundation, so the only reason to move is a simpler setup on a Vite project.

Sources

  1. Jest Blog - jestjs.io - Jest 30 announced June 4, 2025; Jest joins the OpenJS Foundation, May 11, 2022; the team's statements on release pace.
  2. Migrating from Jest - Vitest documentation - Every documented behavior difference between Jest and Vitest, from globals to timers.
  3. Comparisons with Other Test Runners - Vitest documentation - Vitest's own case for replacing Jest on Vite projects, and its claim of compatibility with most of the Jest API.
  4. jest - npm - latest version, release dates, license and last week's downloads, read on November 29, 2026
  5. vitest - npm - latest version, release dates, license and last week's downloads, read on November 29, 2026

Sources checked on 2026-11-28. Tools change status quickly; if this date is old, read the sources before acting on it.