Plate 21
Vitest 5.0.3 vs 4.1.10: Should You Upgrade? (20-File Timing)
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.
Aditya Challa4 min read
No affiliate links. On 5 Oct 2026 (Asia/Calcutta) I timed the same 20-file / 40-test suite under pool: 'forks' on Node 22.20.0: Vitest 5.0.3 median wall clock ~512 ms vs Vitest 4.1.10 median ~547 ms (three warm runs each). That is the upgrade decision number for small unit suites—plus the hard engine gate (Node ^22.12.0 || ^24 || ≥26, peer Vite ≥6.4).
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.
| Runner | Node | Run 1 | Run 2 | Run 3 | Median |
|---|---|---|---|---|---|
| Vitest 4.1.10 + Vite 6.4.0 | 22.20.0 | 547 ms | 598 ms | 530 ms | ~547 ms |
| Vitest 5.0.3 + Vite 6.4.0 | 22.20.0 | 528 ms | 512 ms | 482 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)
- Node ≥ 22.12 and Vite ≥ 6.4 (Yarn users: add
viteexplicitly—it is a peer now). clearMocks: trueby default—fix order-dependent mock history.- Unawaited
.resolves/.rejects/toMatchFileSnapshotfail the test (no more soft warn). vi.mock/vi.hoistedoutside top level now throw.- Inline projects inherit root config (
extendsdefaults true) and may share the Vite server. - Browser / reporter artifact paths moved under
.vitest/; UI needs the printed auth token. - Bench API:
benchis 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.
Sources
- https://vitest.dev/blog/vitest-5.html
- https://vitest.dev/guide/migration.html
- https://www.npmjs.com/package/vitest
- https://github.com/vitest-dev/vitest/releases
- https://github.com/vitest-dev/benchmarks
- https://vitest.dev/guide/
- https://vite.dev/
- https://nodejs.org/en/blog/release
Related
- https://www.shoppercove.com/blog/vite-8-3-2-renderbuilturl-bundled-dev-sourcemaps-october-2026
- https://www.shoppercove.com/blog/vite-plus-1-0-unified-toolchain-october-2026
- https://www.shoppercove.com/blog/playwright-1-63-test-locks-october-2026
- https://www.shoppercove.com/blog/oxlint-1-87-react-suggestions-a11y-fixes-october-2026
- https://www.shoppercove.com/blog/pnpm-12-9-1-rust-rewrite-wasm-split-october-2026
- https://www.shoppercove.com/blog/bun-1-4-2-elysia-als-cmyk-jpeg-october-2026
- https://www.shoppercove.com/blog/eslint-10-12-release-october-2026
- https://www.shoppercove.com/blog/typescript-eslint-8-71-no-unsafe-enum-assignment-october-2026
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.
Related links
Plate 25
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.
5 Oct 2026
Plate 68
pnpm vs npm vs Bun: Which Installs Fastest? 14s, 3.1s, 1.5s
npm 12.2.0 vs pnpm 12.9.1 vs Bun 1.4.2 on one 24-dependency React + Vite app: from scratch 14.2 s / 3.1 s / 1.5 s; lockfile + warm cache 2.9 s / 0.28 s / 0.27 s; lockfile + empty cache 3.9 s / 2.3 s / 0.45 s. Disk, lockfile size and the pnpm phantom-dependency catch.
5 Oct 2026
Plate 24
SvelteKit 3 Is Here (Oct 1, 2026): Migration Checklist for Teams
3 Oct 2026