ShopperCove
Menu
All writingBlogTopicsCategoriesAboutRSS
Blog
Categories
Observability & SRE62All categories
Topics
sre111localhost lab102performance70python58javascript47bundle size36benchmarking35node.js35web development21typescript19benchmark16content creation15All topics
About
Loading article…

ShopperCove

Hands-on notes on developer tools, written after the tool has actually been run.

All writingBlogCategoriesTopicsAboutPrivacyRSS

© 2026 ShopperCove

On this page

  1. Should you upgrade to Vitest 5?
  2. What I measured (ShopperCove box)
  3. clearMocks default (confirmed)
  4. Breaking-change checklist (skim before `pnpm up`)
  5. Bottom line
  6. FAQ
  7. Is Vitest 5 faster than Vitest 4?
  8. What Node version does Vitest 5 need?
  9. What breaks when upgrading to Vitest 5?
  10. Sources
  11. Related
  1. Blog

Is Vitest 5 Faster Than Vitest 4? We Timed It

Vitest 5 upgrade decision with ShopperCove timing: 20-file forks suite median ~512 ms on 5.0.3 vs ~547 ms on 4.1.10 (Node 22.20.0). Engines require Node 22.12+ and Vite 6.4+. clearMocks defaults true. No affiliate.

5 October 2026·4 min read

Summary

Disclosure

This post contains affiliate links. If you buy through them, I may earn a commission at no extra cost to you. I only make firsthand claims about products I have actually used.

On this page
  1. Should you upgrade to Vitest 5?
  2. What I measured (ShopperCove box)
  3. clearMocks default (confirmed)
  4. Breaking-change checklist (skim before `pnpm up`)
  5. Bottom line
  6. FAQ
  7. Is Vitest 5 faster than Vitest 4?
  8. What Node version does Vitest 5 need?
  9. What breaks when upgrading to Vitest 5?
  10. Sources
  11. Related

Vitest 5 is worth upgrading to if you already run Node 22.12+ (or 24/26) and Vite 6.4+: on the same 20-file, 40-test forks suite, Vitest 5.0.3 had a median of about 512 ms against about 547 ms on 4.1.10 (about 6% faster). Stay on 4 until you can raise Node and Vite, and check tests that rely on mock call history, because clearMocks now defaults to true.

Should you upgrade to Vitest 5?

Yes if you already run Node 22.12+ (or 24 / 26) and Vite 6.4+, want the Vitest 5 performance work (shared Vite server for inline projects, stable fsModuleCache, faster vm pools / Browser Mode), and can absorb migration defaults like clearMocks: true. Wait if you are still on Node 20, cannot bump Vite yet, or your suite relies on mock call history leaking across tests without an explicit reset.

npm’s current line is vitest@5.0.3 (modified 2026-09-30T11:30:42Z / ~17:00 IST). The 5.0.0 blog line landed 3 Sep 2026.

What I measured (ShopperCove box)

Identical fixtures: twenty utilN.ts + utilN.test.ts pairs, vitest.config.ts with pool: 'forks', no isolation change, no coverage.

RunnerNodeRun 1Run 2Run 3Median
Vitest 4.1.10 + Vite 6.4.022.20.0547 ms598 ms530 ms~547 ms
Vitest 5.0.3 + Vite 6.4.022.20.0528 ms512 ms482 ms~512 ms

On this tiny suite the win is modest (~6%). Vitest’s own benchmarks write-up shows much larger drops on heavier apps (for example their deps-heavy vmThreads cell 1.59 s → 0.74 s, about −53%). Treat our number as a local smoke cost, not a claim that every monorepo will see 50% cuts.

package.json engines on 5.0.3: node: '^22.12.0 \|\| ^24.0.0 \|\| >=26.0.0'. Peer vite: ^6.4.0 \|\| ^7.0.0 \|\| ^8.0.0. On this box Node 20.19.2 still executed vitest run for 5.0.3 (40/40 pass), but that is unsupported—migrate Node before you rely on 5 in CI.

clearMocks default (confirmed)

I ran a two-test module where a module-scoped vi.fn() is called in test A, then asserted to have 0 calls at the start of test B. On 5.0.3 that assertion passed—matching the migration note that clearMocks defaults to true (vi.clearAllMocks() before each test). If you depended on cross-test call history, set clearMocks: false or move spies into beforeEach.

Breaking-change checklist (skim before pnpm up)

  1. Node ≥ 22.12 and Vite ≥ 6.4 (Yarn users: add vite explicitly—it is a peer now).
  2. clearMocks: true by default—fix order-dependent mock history.
  3. Unawaited .resolves / .rejects / toMatchFileSnapshot fail the test (no more soft warn).
  4. vi.mock / vi.hoisted outside top level now throw.
  5. Inline projects inherit root config (extends defaults true) and may share the Vite server.
  6. Browser / reporter artifact paths moved under .vitest/; UI needs the printed auth token.
  7. Bench API: bench is a test-context fixture, not a top-level import.

Official detail: Vitest 5 blog and Migration Guide.

Bottom line

Should you upgrade? If you already meet the Node/Vite floor, Vitest 5 is the supported line—our 20-file median ~512 ms vs ~547 ms is a small green light, and the real wins show up on larger / vm / browser suites in Vitest’s own tables. If you are on Node 20, upgrade Node first; do not treat an accidental green run on unsupported Node as production-ready. No affiliate.

FAQ

Is Vitest 5 faster than Vitest 4?

On this small 20-file suite, slightly: median ~512 ms on 5.0.3 vs ~547 ms on 4.1.10. Vitest's own benchmarks show bigger drops on heavier projects, such as 1.59 s to 0.74 s in one vmThreads case.

What Node version does Vitest 5 need?

Node ^22.12.0, ^24.0.0 or >=26.0.0, with Vite ^6.4.0, ^7 or ^8 as a peer. It ran on Node 20.19.2 in this test, but that setup is unsupported.

What breaks when upgrading to Vitest 5?

clearMocks defaults to true, unawaited .resolves/.rejects and toMatchFileSnapshot now fail tests, vi.mock and vi.hoisted outside top level throw, and bench becomes a test-context fixture.

Sources

  • 01npmjs.com/package/vitest
  • 02github.com/vitest-dev/vitest/releases
  • 03github.com/vitest-dev/benchmarks
  • 04vitest.dev/guide/
  • 05vite.devhttps://vite.dev/
  • 06nodejs.org/en/blog/release

Related

  • 01shoppercove.com/blog/vite-8-3-2-renderbuilturl-bundled-dev-sourcemaps-october-2026
  • 02shoppercove.com/blog/vite-plus-1-0-unified-toolchain-october-2026
  • 03shoppercove.com/blog/playwright-1-63-test-locks-october-2026
  • 04shoppercove.com/blog/oxlint-1-87-react-suggestions-a11y-fixes-october-2026
  • 05shoppercove.com/blog/pnpm-12-9-1-rust-rewrite-wasm-split-october-2026
  • 06shoppercove.com/blog/bun-1-4-2-elysia-als-cmyk-jpeg-october-2026
  • 07shoppercove.com/blog/eslint-10-12-release-october-2026
  • 08shoppercove.com/blog/typescript-eslint-8-71-no-unsafe-enum-assignment-october-2026
vitestunit testingnode.jsviteperformancemigrationtesting tools

Lab evidence

What I found running this

Sources read 5 Oct 2026 evening (Asia/Calcutta): vitest.dev/blog/vitest-5.html (3 Sep 2026); vitest.dev/guide/migration.html (Node >=22.12, Vite >=6.4; clearMocks default true; unawaited async asserts fail). npm vitest latest=5.0.3 time.modified 2026-09-30T11:30:42.795Z (~17:00 IST); 5.0.0 published 2026-09-03T12:24:30.312Z. package engines node '^22.12.0 || ^24.0.0 || >=26.0.0'; peer vite '^6.4.0 || ^7.0.0 || ^8.0.0'. Hands-on on box Node 22.20.0: identical 20-file/40-test forks suite — Vitest 4.1.10 (pnpm) warm medians 547/598/530 ms → median ~547 ms; Vitest 5.0.3 warm 528/512/482 ms → median ~512 ms. clearMocks fixture: module-scoped vi.fn() call count cleared between tests on 5.0.3 (2/2 pass). Node 20.19.2 still ran vitest 5.0.3 (unsupported). No ShopperCove production suite changed. No affiliate.

Explore the product

Untested by us. Check what's included, the license and refund terms before you buy.

Ready Client Sites for prebuilt websites

See Ready Client Sites details

AI Traffic Secrets for AI-era SEO

See AI Traffic Secrets details

Notes when a lab post goes up

Occasional email for new hands-on reviews. No sequence and no sponsors.

Explore the product

Untested by us. Check what's included, the license and refund terms before you buy.

Ready Client Sites for prebuilt websites

See Ready Client Sites details

AI Traffic Secrets for AI-era SEO

See AI Traffic Secrets details

Keep reading

  • bun test vs Vitest: 136ms vs 1.67s on 300 Tests

    bun test 1.4.2 vs Vitest 5.0.3 on 300 TypeScript tests in 60 files: warm wall medians 136 ms vs 1,673 ms (~12x); Vitest --no-isolate 765 ms (~5.6x). A 5-file vitest-API check (vi.fn, vi.mock, fake timers, spyOn, it.each, snapshot) passed 7/7 under Bun.

    Hands-on6 Oct 20265 min read

  • Should You Leave Jest for Vitest? 2.0s vs 1.3s

    Jest 30.5.2 vs Vitest 5.0.3 on 40 files / 200 Node tests: wall medians Jest 2027 ms, Vitest isolate-on 2422 ms, Vitest --no-isolate 1287 ms, Jest --runInBand 3346 ms. Both 200/200 pass. Leave Jest after measuring isolate; default isolate can lose.

    Summary5 Oct 20265 min read

  • c12 vs cosmiconfig: 0.58 ms vs 1.08 ms per .mjs Load

    Hands-on6 Oct 20269 min read