5.0.0
Vitest 5 is officially out! This release focuses on performance and brings a lot of new features while fixing long-standing bugs. See our blog post for the official announcement.
🚨 Breaking Changes
- Replace
loupe.inspectwith pretty-format - by @hi-ogawa, Claude Opus 5 (1M context) and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/9609 (3f802) - Remove quotes from string values in
test.for/eachtitle$variable (take 2) - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/10170 (04d37) - Default
attachmentsDirfrom.vitest-attachements/to.vitest/attachments/- by @MdSadiqMd in https://github.com/vitest-dev/vitest/issues/10186 (1ba73) - Remove
sequentialtest/suite options in favor ofconcurrent- by @hi-ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10198 (9229f) - Represent locator as an object instead of a string - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10212 (80f07)
- Inline
expectpackage - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10221 (ad162) - Remove deprecated entry points - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10222 (994c6)
- Require Node.js 22 and Vite 6.4 - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10178 (38762)
- Fail
expect.pollwhen function didn't resolve in time - by @hi-ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10233 (4df04) - Throw an error if hoistable methods are outside the top level scope - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10460 (d0b4f)
toHaveTextContentis strict, addtoMatchTextContentas alternative - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10473 (18f30)- Don't lookup config file from ancestor directories - by @hi-ogawa, OpenAI Codex and Hiroshi Ogawa in https://github.com/vitest-dev/vitest/issues/10428 (945d9)
- Inline
@vitest/runnerpackage, do not publish it anymore - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10511 (6d6e4) - Allow mutating happy-dom/jsdom window object - by @hi-ogawa, Hiroshi Ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10373 (206e8)
- Expose
concurrencyId/workerIdon TestModule's diagnostics, make id 1-based - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10516 (bdd98) - Add
screenshotDirectoryconfig tobrowser.expect.toMatchScreenshot- by @macarie in https://github.com/vitest-dev/vitest/issues/10592 (a60de) - Update
@sinonjs/fake-timersand support mockingTemporal- by @hi-ogawa, Hiroshi Ogawa and OpenCode (gpt-5.6-sol) in https://github.com/vitest-dev/vitest/issues/10654 (f8b15) - Remove webdriverio package - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10675 (5fed6)
- Clear mocks by default before each test - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10613 (0f646)
- Don't emit localStorage warnings on Node 26, fail gracefully when worker fails to start - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10293 (334ed)
- Separate config resolution from the server creation - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10554 (1c0ec)
- Inline projects extend the root config by default - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10750 (fec00)
- Enable mocking Temporal without fake timers - by @fabon-f, Hiroshi Ogawa and OpenCode (gpt-5.6-sol) in https://github.com/vitest-dev/vitest/issues/10757 (ac2d4)
- Support nested projects - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10846 (ec367)
- Use
>as separator in-t, calculateonlyonce - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10686 (a0b20) - Fail the test when an asynchronous assertion is not awaited - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10868 (86d4a)
- Share the Vite server between inline projects - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10848 (d87c9)
- Parse files statically in vitest list by default - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/11088 (51e94)
- benchmark:
- Rewrite the public API - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10113 (19f6e)
- browser:
- Iframe scale - by @macarie in https://github.com/vitest-dev/vitest/issues/9745 (b6398)
- Enable
locators.exactby default - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10430 (e2032) - Require
sessionIdfor orchestrator html request - by @hi-ogawa, Hiroshi Ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10522 (79b7d) - Save failure screenshots in
attachmentsDir- by @macarie in https://github.com/vitest-dev/vitest/issues/10917 (3b5bb)
- coverage:
include/excludeglobs too eager - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/9818 (edacb)- Allow
thresholds.perFileto accept an object - by @vladlenskiy and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10190 (13b78)
- expect:
- Fix
toThrow("")behavior by reverting #6710 - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/9643 and https://github.com/vitest-dev/vitest/issues/6710 (6c3e4)
- Fix
- mocker:
- Deserialize automock as automock - by @nami8824 in https://github.com/vitest-dev/vitest/issues/10192 (2f892)
- reporters:
blobreporter and--merge-reportsdefault to.vitest/blob/- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10232 (d22b0)- Write json and junit reporter output files to
.vitestby default - by @hi-ogawa, Hiroshi Ogawa, OpenCode (gpt-5.6-sol) and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10621 (58577)
- spy:
- Preserve class mock prototype methods on instances - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10910 (6093d)
- types:
- Add better promise support in expects and matchers - by @samchungy and @sheremet-va in https://github.com/vitest-dev/vitest/issues/8266 (41f55)
- ui:
- Harden UI API access - by @hi-ogawa, Hiroshi Ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10583 (4c26d)
- Change html reporter default output to
.vitest- by @hi-ogawa and Hiroshi Ogawa in https://github.com/vitest-dev/vitest/issues/10620 (29c36)
🚀 Features
- Add
createReportand.vitestreport directory convention - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/9993 (72a6d) - Expose default reporters through
configDefaults.reporters- by @hi-ogawa and Claude Opus 5 (1M context) in https://github.com/vitest-dev/vitest/issues/10219 (083f6) - Support merge reports for non-sharded multi-environment runs (take 2) - by @hi-ogawa, Claude Opus 5 (1M context), OpenAI Codex and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10031 (e60b2)
- Add
logger.formatError- by @hi-ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10268 (2c5f3) - Support typescript build mode - by @lishaduck in https://github.com/vitest-dev/vitest/issues/9870 (106da)
- Add toggable
injectCjsGlobalsoption - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10709 (82671) - Promote fsModuleCache to a top-level option - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10734 (78ed7)
- Support non-ascii characters in
for/eachtitle placeholders - by @k-yle in https://github.com/vitest-dev/vitest/issues/10773 (15e0a) - Report the duration breakdown as percentages - by @sheremet-va and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10820 (c67d2)
- Promote parseSpecifications out of experimental - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/11087 (b628c)
- Promote clearCache out of experimental - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/11086 (d4fe1)
- api:
- Expose logs recorded during the test - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10277 (cba20)
- benchmark:
- Add pluggable benchmark provider API - by @GuillaumeLagrange and @sheremet-va in https://github.com/vitest-dev/vitest/issues/10799 (86c70)
- browser:
- Export aria tree utils - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/10171 (c3423)
- Support dom snapshot trace view - by @hi-ogawa, Claude Opus 5 (1M context) and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10102 (7eddd)
- Provide project reference in
ToMatchScreenshotResolvePath- by @macarie and @sheremet-va in https://github.com/vitest-dev/vitest/issues/10138 (16654) - Show aria tree on locator element error - by @hi-ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10257 (04f04)
- Support custom
kindinpage.mark- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10302 (053e8) - Live update trace view on watch UI - by @hi-ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10296 (78c11)
- Add
context.markfor custom command tracing - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10329 (aa514) - Show trace view steps in editor panel - by @hi-ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10404 (8c4b6)
- Display nested mark trace in UI - by @hi-ogawa, Hiroshi Ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10437 (86ffc)
- cli:
- Add
--repeatsCLI option - by @todor-a in https://github.com/vitest-dev/vitest/issues/10504 (ee48b) - Support -p shorthand for --project - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10826 (1addd)
- Add
- coverage:
- V8 to track
node:child_processandnode:worker_threadscontexts - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/9976 (9baa5) thresholds.autoUpdateto receive previous threshold as argument - by @wouterkroes in https://github.com/vitest-dev/vitest/issues/10495 (04f81)- Switch to
@vitest/istanbuljspackages - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/11053 (5f6a5)
- V8 to track
- junit-reporter:
- Add jest-junit-compatible naming options - by @neumaennl, neumaennl, Martin Neumann and Copilot in https://github.com/vitest-dev/vitest/issues/10189 (27393)
- reporter:
- Support html reporter single file output - by @hi-ogawa, OpenAI Codex and Claude Opus 5 (1M context) in https://github.com/vitest-dev/vitest/issues/10235 (f757e)
- Add custom GitHub Actions summary title - by @heyJonBray and @macarie in https://github.com/vitest-dev/vitest/issues/10891 (4363c)
- ui:
- Highlight editor source locations - by @sheremet-va, Hiroshi Ogawa and OpenCode (gpt-5.6-sol) in https://github.com/vitest-dev/vitest/issues/11004 (bce2d)
- Navigate trace steps with keyboard and remove indirect editor focus - by @sheremet-va, Hiroshi Ogawa and OpenCode (gpt-5.6-sol) in https://github.com/vitest-dev/vitest/issues/11005 (6816f)
- Persist trace view selection in URL - by @hi-ogawa, Hiroshi Ogawa and OpenCode (gpt-5.6-sol) in https://github.com/vitest-dev/vitest/issues/10981 (3069e)
- Toggle trace target highlight - by @hi-ogawa, Hiroshi Ogawa and OpenCode (gpt-5.6-sol) in https://github.com/vitest-dev/vitest/issues/11049 (cd63e)
- Add link to open playwright trace - by @hi-ogawa, Hiroshi Ogawa and OpenCode (gpt-5.6-sol) in https://github.com/vitest-dev/vitest/issues/11059 (58f02)
- vitest:
- Create
vi.when()- by @macarie in https://github.com/vitest-dev/vitest/issues/10174 (3900e)
- Create
- vm:
- Support
require(esm)in vm pools - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10829 (01298)
- Support
🐞 Bug Fixes
- Global
sequence.concurrent: truewith top-leveltest(..., { concurrent: false })+ depreactesequentialtest API and options - by @hi-ogawa, OpenAI Codex and @sheremet-va in https://github.com/vitest-dev/vitest/issues/10194 (9387f) - Test
tagsoptions should overwrite inherited suite options + inherit suite options intaskAPI - by @hi-ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10216 (457db) - Udpate optimize deps config - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10223 (95dc6)
- Shell injection safety via github.ref_name in publish workflow - by @lloyd-c137 and lloyd-c137 in https://github.com/vitest-dev/vitest/issues/10327 (dd020)
- Make
attachmentsDirroot only config - by @hi-ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10334 (fab1b) - Apply cjs interop for truthy
__esModule- by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/10363 (2b135) - Preserve
vi.defineHelpercallsite for async error stack - by @macayu17 and @hi-ogawa in https://github.com/vitest-dev/vitest/issues/10415 (ac697) - Respect
disableConsoleInterceptin browser mode - by @Copilot, Hiroshi Ogawa, @hi-ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10391 (66110) - ForceRerunTriggers uses directory globs against files - by @Patrick-Clausen and Patrick Clausen in https://github.com/vitest-dev/vitest/issues/10421 and https://github.com/vitest-dev/vitest/issues/10420 (4fee2)
- Unify typechecking and ast collection - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10449 (af993)
- Don't print typecheck warning more than once - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10461 (15275)
- Correct collumn when parsing tests - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10467 (7c2fc)
- Fix mixed stdout/stderr log timestamps in
onUserConsoleLog- by @Copilot, Hiroshi Ogawa, @hi-ogawa and @sheremet-va in https://github.com/vitest-dev/vitest/issues/10308 (62756) - Fix
importOriginalwith optimizer and query import - by @davidxharris, David Harris, @hi-ogawa, Hiroshi Ogawa and OpenAI Codex in https://github.com/vitest-dev/vitest/issues/10469 (6a3bb) - Correct transform time calculation in merged report - by @potatomatoooo and @hi-ogawa in https://github.com/vitest-dev/vitest/issues/10570 and https://github.com/vitest-dev/vitest/issues/10578 (b7897)
- Fix
setImmediateawait in detect-async-leak - by @hi-ogawa and Hiroshi Ogawa in https://github.com/vitest-dev/vitest/issues/10608 (dd62b) - Fix per-project
sequenceconfig - by @hi-ogawa, Hiroshi Ogawa and OpenCode (gpt-5.6-sol) in https://github.com/vitest-dev/vitest/issues/10659 (40cdc) - Add handshake timeout to iframe communication - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10656 (3545f)
- Don't print column in test names when
includeTaskLocationis enabled - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10681 (bd9cc) - Disable server HMR before plugins read it in their config hook - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10731 (e060b)
- Close the pool before the Vite servers - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10725 (96fa6)
- Remove listeners in the typecheck worker's
off- by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10741 (d758b) - Keep per-file isolation in vm pools when maxWorkers is 1 - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10743 (83ab9)
- Node.js 20 deprecation warning for
ci.yml- by @hirehamir in https://github.com/vitest-dev/vitest/issues/10759 (2127f) - Prevent node builtins double prefix - by @malobre in https://github.com/vitest-dev/vitest/issues/10630 and https://github.com/vitest-dev/vitest/issues/10767 (22d35)
- Set non-zero exit code when teardown throws during close - by @zakcutner and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10794 (22116)
- Don't race the typechecker spawn grace period on windows - by @xevrion in https://github.com/vitest-dev/vitest/issues/10814 (b19e5)
- Coalesce concurrent watch-mode restarts, deflake the pool stderr fixture - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10822 (a31f8)
- Prevent
vitest --typecheckfrom reporting a false success when thetscprocess crashes - by @hitenkalda and Hiten Kalda in https://github.com/vitest-dev/vitest/issues/10705 (a1b05) - Collect in-source tests when the module is cached - by @koutaro-masaki in https://github.com/vitest-dev/vitest/issues/10577 and https://github.com/vitest-dev/vitest/issues/10589 (a7bf2)
- Swap replace() arguments so timeout error stack shows the real message - by @lazerg in https://github.com/vitest-dev/vitest/issues/10875 (aba0f)
- Stale mock metadata breaks automocking with isolate:false - by @kade-robertson in https://github.com/vitest-dev/vitest/issues/10145 and https://github.com/vitest-dev/vitest/issues/10541 (8e210)
- Don't lose worker output on teardown, deflake timing-sensitive tests - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10842 (1216b)
- Revive global concurrency limit for test lifecycle - by @hi-ogawa, Hiroshi Ogawa, OpenCode (gpt-5.6-sol) and @sheremet-va in https://github.com/vitest-dev/vitest/issues/10928 (cf917)
- Own the post-restart rerun, keep
process.exitdisabled in workers - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10963 (5e69a) - Preserve correct root during resolve config - by @AriPerkkio and @sheremet-va in https://github.com/vitest-dev/vitest/issues/10909 (210ba)
- Combine multiple --project filters correctly - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10988 (66c1c)
- Fix
recordArtifactlocation withvi.defineHelper- by @hi-ogawa, Hiroshi Ogawa and OpenCode (gpt-5.6-sol) in https://github.com/vitest-dev/vitest/issues/11047 (c2186) - Invalidate resolved setup files - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/11073 and https://github.com/vitest-dev/vitest/issues/11081 (488c0)
- Accept awaited value in vi.when thenResolve - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/11084 (c10a1)
- Ignore computed member calls in static collection - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/11085 (130f7)
- Don't duplicte
oxc.targetif user provides a custom array - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/11095 (848d7) - Propagate --maxWorkers to projects - by @Gaurav1112 in https://github.com/vitest-dev/vitest/issues/11102 (2122f)
- Apply queued mocks from doMock() in queue order - by @juliandescottes and Claude Opus 5 (1M context) in https://github.com/vitest-dev/vitest/issues/10706 and https://github.com/vitest-dev/vitest/issues/11127 (f08ce)
- Add a warning if inline project has duplicate plugins due to unexpected
extends: true- by @sheremet-va in https://github.com/vitest-dev/vitest/issues/11120 (584cf) - Treat test.describe as a suite during static collection - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/11128 (d46a7)
- browser:
- Fix trace highlight of shadow dom on webdriverio - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/10227 (b01af)
- Simplify orchestrator otel carrier - by @hi-ogawa in https://github.
These notes run past the length kept in the archive. The rest is on the publisher’s page.