Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save TravnikovDev/3ba58d4626b1dc1c5094ffc4ea75cd4e to your computer and use it in GitHub Desktop.

Select an option

Save TravnikovDev/3ba58d4626b1dc1c5094ffc4ea75cd4e to your computer and use it in GitHub Desktop.
LinkedIn Post - 2026-03-17 05:12

I swapped Jest for Vitest and my tests felt like I took ankle weights off. Watch mode went from yawn to snap. ⚡

Before I drink the Kool-Aid, I had my AI research agent pull the docs and timelines. The numbers don’t lie, but the story is not just speed.

How they think:

  • Jest builds its own little world in Node with a custom module system and transformers. Powerful, but you pay a tax at startup and in config. ESM support is still marked experimental in their docs in 2026.
  • Vitest rides Vite’s pipeline. ESM-first, TypeScript just works, transforms run through esbuild or swc, and the module graph makes re-runs fly. You can choose jsdom or happy-dom, even an edge runtime, and run tests in a real browser when you must.

Feature parity is boringly good: expect, snapshots, spies, fake timers. The one gotcha that bites migrations - jest.mock is hoisted, vi.mock is not. Put vi.mock at the top or in setup files. Coverage is also different: Vitest uses provider plugins and counts all matched files in thresholds by default.

Timeline in one breath:

  • 2014-2016: Jest is born at Facebook, ships snapshots.
  • 2021: jest-circus becomes default. ESM groundwork lands, still labeled experimental today.
  • 2022: Vitest launches as Vite-native with a Jest-like API.
  • 2023-2024: Vitest hits v1, tight docs for envs, coverage, migration.
  • 2025-2026: Browser mode and edge runtime mature as Vite 5-6 era rolls in.

Reality check:

  • On Vite + ESM modules + TypeScript, Vitest feels illegally fast and the stack traces are clean.
  • On legacy CommonJS, mixed transforms, React Native, or Electron, Jest is steadier and its ecosystem is massive. Next.js docs still show Jest first. Big cross-platform monorepos often pick Jest for uniformity. And yes, benchmarks are messy. Some teams see order-of-magnitude gains with Vitest; others hit weird timer edges or memory bumps in certain configs. Test in your repo, not your imagination.

My take:

  • New Vite-based front-end or a modern ESM+TS library - use Vitest. Stop debating.
  • React Native, legacy Node/CommonJS, heavy Jest plugins or Next.js glue - stick with Jest and ship.

What are you running today and why? Any migration scars or speed wins worth sharing? 🧪

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