Releases: vitest-dev/vitest
Releases · vitest-dev/vitest
v5.0.0-beta.2
Immutable
release. Only release title and notes can be modified.
🚨 Breaking Changes
- Default
attachmentsDirfrom.vitest-attachements/to.vitest/attachments/- by @MdSadiqMd in #10186 (1ba73) - Remove
sequentialtest/suite options in favor ofconcurrent- by @hi-ogawa and Codex in #10198 (9229f) - Represent locator as an object instead of a string - by @sheremet-va in #10212 (80f07)
- Inline
expectpackage - by @sheremet-va in #10221 (ad162) - Remove deprecated entry points - by @sheremet-va in #10222 (994c6)
- mocker: Deserialize automock as automock - by @nami8824 in #10192 (2f892)
- reporters:
blobreporter and--merge-reportsdefault to.vitest/blob/- by @AriPerkkio in #10232 (d22b0)
🚀 Features
- Expose default reporters through
configDefaults.reporters- by @hi-ogawa and Claude Sonnet 4.6 in #10219 (083f6) - Support merge reports for non-sharded multi-environment runs (take 2) - by @hi-ogawa, Claude Sonnet 4.6, Codex and @AriPerkkio in #10031 (e60b2)
- Add
logger.formatError- by @hi-ogawa and Codex in #10268 (2c5f3) - browser: Provide project reference in
ToMatchScreenshotResolvePath- by @macarie and @sheremet-va in #10138 (16654) - coverage: V8 to track
node:child_processandnode:worker_threadscontexts - by @AriPerkkio in #9976 (9baa5) - junit-reporter: Add jest-junit-compatible naming options - by @neumaennl, neumaennl, @neumann4soft and Copilot in #10189 (27393)
🐞 Bug Fixes
- Global
sequence.concurrent: truewith top-leveltest(..., { concurrent: false })+ depreactesequentialtest API and options - by @hi-ogawa, Codex and @sheremet-va in #10194 (9387f) - Test
tagsoptions should overwrite inherited suite options + inherit suite options intaskAPI - by @hi-ogawa and Codex in #10216 (457db) - Udpate optimize deps config - by @sheremet-va in #10223 (95dc6)
- browser:
- deps:
- runner:
- snapshot:
- spy:
- Support private method spy types - by @cyphercodes in #10172 and #10213 (628ab)
View changes on GitHub
v5.0.0-beta.1
🚨 Breaking Changes
- Replace
loupe.inspectwith pretty-format - by @hi-ogawa, Claude Sonnet 4.6 and Codex in #9609 (3f802) - Remove quotes from string values in
test.for/eachtitle$variable (take 2) - by @hi-ogawa in #10170 (04d37) - browser: Iframe scale - by @macarie in #9745 (b6398)
- coverage:
include/excludeglobs too eager - by @AriPerkkio in #9818 (edacb) - expect: Fix
toThrow("")behavior by reverting #6710 - by @hi-ogawa in #9643 and #6710 (6c3e4)
🚀 Features
- Add
createReportand.vitestreport directory convention - by @AriPerkkio in #9993 (72a6d) - browser:
🐞 Bug Fixes
- snapshot: Fail test when snapshot assertion is used with
test.fails- by @hi-ogawa in #10090 (e1aa7)
View changes on GitHub
v4.1.5
🚀 Experimental Features
- coverage: Istanbul to support
instrumenteroption - by @BartWaardenburg and @AriPerkkio in #10119 (0e0ff)
🐞 Bug Fixes
- --project negation excludes browser instances - by @felamaslen in #10131 (9423d)
- Project color label on html reporter - by @hi-ogawa in #10142 (596f7)
- Fix
vi.defineHelpercalled as object method - by @hi-ogawa in #10163 (122c2) - Alias
agentreporter tominimal- by @sheremet-va in #10157 (663b9) - Respect diff config options in soft assertions - by @Copilot, sheremet-va and @sheremet-va in #8696 (9787d)
- Respect diff config options in soft assertions " - by @sheremet-va in #8696 (7dc6d)
- ast-collect: Recognize _vi_import prefix in static test discovery - by @Yejneshwar in #10129 (32546)
- coverage: Descriptive error message when reports directory is removed during test run - by @DaveT1991 and @AriPerkkio in #10117 (14133)
- snapshot: Increase default snapshot max output length - by @hi-ogawa and Codex in #10150 (21e66)
- ui: Fix jsx/tsx syntax highlight - by @hi-ogawa in #10152 (f1b1f)
- web-worker: Support MessagePort objects referenced inside postMessage data - by @whitphx and Claude Opus 4.6 (1M context) in #9927 and #10124 (7ad7d)
- api: Make test-specification options writable - by @sheremet-va in #10154 (6abd5)
View changes on GitHub
v4.1.4
🚀 Experimental Features
- coverage:
- experimental:
- Expose
assertionas a public field - by @sheremet-va in #10095 (a120e) - Support aria snapshot - by @hi-ogawa, Claude Opus 4.6 (1M context), @AriPerkkio, Codex and @sheremet-va in #9668 (d4fbb)
- Expose
- reporter:
- Add filterMeta option to json reporter - by @nami8824 and @sheremet-va in #10078 (b77de)
🐞 Bug Fixes
- Use "black" foreground for labeled terminal message to ensure contrast - by @hi-ogawa in #10076 (203f0)
- Make
expect(..., message)consistent as error message prefix - by @hi-ogawa and Codex in #10068 (a1b5f) - Do not hoist imports whose names match class properties . - by @SunsetFi in #10093 and #10094 (0fc4b)
- browser: Spread user server options into browser Vite server in project - by @GoldStrikeArch in #10049 (65c9d)
View changes on GitHub
v4.1.3
🚀 Experimental Features
- Add
experimental.preParseflag - by @sheremet-va in #10070 (78273) - Support
browser.locators.exactoption - by @sheremet-va in #10013 (48799) - Add
TestAttachment.bodyEncoding- by @hi-ogawa in #9969 (89ca0) - Support custom snapshot matcher - by @hi-ogawa, Claude Sonnet 4.6 and Codex in #9973 (59b0e)
🐞 Bug Fixes
- Advance fake timers with
expect.pollinterval - by @hi-ogawa and Claude Sonnet 4.6 in #10022 (3f5bf) - Add
@vitest/coverage-v8and@vitest/coverage-istanbulas optional dependency - by @alan-agius4 in #10025 (146d4) - Fix
defineHelperfor webkit async stack trace + update playwright 1.59.0 - by @hi-ogawa in #10036 (5a5fa) - Fix suite hook throwing errors for unused auto test-scoped fixture - by @hi-ogawa and Claude Sonnet 4.6 in #10035 (39865)
- expect:
- snapshot:
- ui:
- Don't leak vite types - by @sheremet-va in #10005 (fdff1)
- vm:
View changes on GitHub
v4.1.2
This release bumps Vitest's flatted version and removes version pinning to resolve flatted's CVE related issues (#9975).
🐞 Bug Fixes
- Don't resolve
setupFilesfrom parent directory - by @hi-ogawa in #9960 (7aa93) - Ensure sequential mock/unmock resolution - by @hi-ogawa and Claude Opus 4.6 in #9830 (7c065)
- browser: Take failure screenshot if
toMatchScreenshotcan't capture a stable screenshot - by @macarie in #9847 (faace) - coverage: Correct
coverageConfigDefaultsvalues and types - by @Arthie in #9940 (b3c99) - pretty-format: Fix output limit over counting - by @hi-ogawa in #9965 (d3b7a)
- Disable colors if agent is detected - by @sheremet-va and @AriPerkkio in #9851 (6f97b)
View changes on GitHub
v4.1.1
🚀 Features
- experimental:
- Expose
matchesTagsto test if the current filter matches tags - by @sheremet-va in #9913 (eec53) - Introduce
experimental.vcsProvider- by @sheremet-va in #9928 (56115)
- Expose
🐞 Bug Fixes
- Mark
TestProject.testFilesListinternal properly - by @sapphi-red in #9867 (54f26) - Detect fixture that returns without calling
use- by @oilater in #9831 and #9861 (633ae) - Drop vite 8.beta support - by @AriPerkkio in #9862 (b78f5)
- Type regression in vi.mocked() static class methods - by @purepear and @hi-ogawa in #9857 (90926)
- Properly re-evaluate actual modules of mocked external - by @hi-ogawa in #9898 (ae5ec)
- Preserve coverage report when html reporter overlaps - by @hi-ogawa in #9889 (2d81a)
- Provide
vi.advanceTimersto the preview provider - by @sheremet-va in #9891 (1bc3e) - Don't leak event listener in playwright provider - by @sheremet-va in #9910 (d9355)
- Open browser in
--standalonemode without running tests - by @sheremet-va in #9911 (e78ad) - Guard disposable and optional
body- by @sheremet-va in #9912 (6fdb2) - Resolve
retry.conditionRegExp serialization issue - by @nstepien and @hi-ogawa in #9942 (7b605) - collect:
- Don't treat extra props on
testreturn as tests - by @sheremet-va in #9871 (141e7)
- Don't treat extra props on
- coverage:
- Simplify provider types - by @AriPerkkio in #9931 (aaf9f)
- Load built-in provider without module runner - by @AriPerkkio in #9939 (bf892)
- expect:
- pretty-format:
View changes on GitHub
v4.1.0
Vitest 4.1 is out!
This release page lists all changes made to the project during the 4.1 beta. To get a review of all the new features, read our blog post.
🚀 Features
- Return a disposable from doMock() - by @kirkwaiblinger in #9332 (e3e65)
- Added chai style assertions - by @ronnakamoto and @sheremet-va in #8842 (841df)
- Update to sinon/fake-timers v15 and add
setTickModeto timer controls - by @atscott and @sheremet-va in #8726 (4b480) - Expose matcher types - by @sheremet-va in #9448 (3e4b9)
- Add
toTestSpecificationto reported tasks - by @sheremet-va in #9464 (1a470) - Show a warning if
vi.mockorvi.hoistedare declared outside of top level of the module - by @sheremet-va in #9387 (5db54) - Track and display expectedly failed tests (.fails) in UI and CLI - by @Copilot, sheremet-va and @sheremet-va in #9476 (77d75)
- Support tags - by @sheremet-va in #9478 (de7c8)
- Implement
aroundEachandaroundAllhooks - by @sheremet-va in #9450 (2a8cb) - Stabilize experimental features - by @sheremet-va in #9529 (b5fd2)
- Accept
neworallin--updateflag - by @sheremet-va in #9543 (a5acf) - Support
metain test options - by @sheremet-va in #9535 (7d622) - Support type inference with a new
test.extendsyntax - by @sheremet-va in #9550 (e5385) - Support vite 8 beta, fix type issues in the config with different vite versions - by @sheremet-va in #9587 (99028)
- Add assertion helper to hide internal stack traces - by @hi-ogawa and Claude Opus 4.6 in #9594 (eeb0a)
- Store failure screenshots using artifacts API - by @macarie in #9588 (24603)
- Allow
vitest listto statically collect tests instead of running files to collect them - by @sheremet-va in #9630 (7a8e7) - Add
--detect-async-leaks- by @AriPerkkio in #9528 (c594d) - Implement
mockThrowandmockThrowOnce- by @thor-juhasz and @sheremet-va in #9512 (61917) - Support
update: "none"and add docs about snapshots behavior on CI - by @hi-ogawa in #9700 (05f18) - Support playwright
launchOptionswithconnectOptions- by @hi-ogawa in #9702 (f0ff1) - Add
page/locator.markAPI to enhance playwright trace - by @hi-ogawa in #9652 (d0ee5) - api:
- Support tests starting or ending with
testinexperimental_parseSpecification- by @jgillick and Jeremy Gillick in #9235 (2f367) - Add filters to
createSpecification- by @sheremet-va in #9336 (c8e6c) - Expose
runTestFilesas alternative torunTestSpecifications- by @sheremet-va in #9443 (43d76) - Add
allowWriteandallowExecoptions toapi- by @sheremet-va in #9350 (20e00) - Allow passing down test cases to
toTestSpecification- by @sheremet-va in #9627 (6f17d)
- Support tests starting or ending with
- browser:
- Add
userEvent.wheelAPI - by @macarie in #9188 (66080) - Add
filterNodeoption to prettyDOM for filtering browser assertion error output - by @Copilot, sheremet-va and @sheremet-va in #9475 (d3220) - Support playwright persistent context - by @hi-ogawa, Claude Opus 4.6 and @sheremet-va in #9229 (f865d)
- Added
detailsPanelPositionoption and button - by @shairez in #9525 (c8a31) - Use BlazeDiff instead of pixelmatch - by @macarie in #9514 (30936)
- Add
findElementand enable strict mode in webdriverio and preview - by @sheremet-va in #9677 (c3f37)
- Add
- cli:
- Add @bomb.sh/tab completions - by @AmirSa12 and @sheremet-va in #8639 (200f3)
- coverage:
- Support
ignore start/stopignore hints - by @AriPerkkio in #9204 (e59c9) - Add
coverage.changedoption to report only changed files - by @kykim00 and @AriPerkkio in #9521 (1d939)
- Support
- experimental:
- Add
onModuleRunnerhook toworker.init- by @sheremet-va in #9286 (e977f) - Option to disable the module runner - by @sheremet-va and @AriPerkkio in #9210 (9be61)
- Add
importDurations: { limit, print }options - by @hi-ogawa, Claude Opus 4.6 and @sheremet-va in #9401 (7e10f) - Add print and fail thresholds for
importDurations- by @hi-ogawa and Claude Opus 4.6 in #9533 (3f7a5)
- Add
- fixtures:
- Pass down file context to
beforeAll/afterAll- by @sheremet-va in #9572 (c8339)
- Pass down file context to
- reporters:
- runner:
- Enhance
retryoptions - by @MazenSamehR, Matan Shavit, @AriPerkkio and @sheremet-va in #9370 (9e4cf)
- Enhance
- ui:
- Allow run individual test/suites - by @userquin in #9465 [(73b10)](https://github.com/vite...
v4.1.0-beta.6
🚀 Features
- Add
page/locator.markAPI to enhance playwright trace - by @hi-ogawa in #9652 (d0ee5) - vitest: Add run summary in GitHub Actions Reporter - by @macarie and jhnance in #9579 (96bfc)
🐞 Bug Fixes
- Fix
URL.nameon jsdom - by @hi-ogawa in #9767 (031f3) - Save and restore module graph in blob reporter - by @hi-ogawa in #9740 (84355)
- Don't silence reporter errors from test runtime events handler in normal run and --merge-reports - by @hi-ogawa in #9727 (4072d)
- Fix
vi.importActual()for virtual modules - by @hi-ogawa and Claude Opus 4.6 in #9772 (1e89e) - Throw
FixtureAccessErrorif suite hook accesses undefined fixture - by @sheremet-va in #9786 (fc2ce) - Allow hyphens in project config file name pattern - by @Koutaro-Hanabusa and @hi-ogawa in #9760 (33e96)
- Manual and redirect mock shouldn't
loadortransformoriginal module - by @hi-ogawa and Claude Opus 4.6 in #9774 (a8216) hideSkippedTestsshould not hidetest.todo- by @oilater in #9562 and #9781 (8181e)- browser: Types of
getCDPSessionandcdp()- by @AriPerkkio in #9716 (689a2)
View changes on GitHub
v4.1.0-beta.5
🚀 Features
- Implement
mockThrowandmockThrowOnce- by @thor-juhasz and @sheremet-va in #9512 (61917) - Support
update: "none"and add docs about snapshots behavior on CI - by @hi-ogawa in #9700 (05f18) - Support playwright
launchOptionswithconnectOptions- by @hi-ogawa in #9702 (f0ff1) - browser:
- coverage:
- Add
coverage.changedoption to report only changed files - by @kykim00 and @AriPerkkio in #9521 (1d939)
- Add
- ui:
🐞 Bug Fixes
- Don't propagate nested
aroundEach/Allerrors but aggregate them on runner - by @hi-ogawa in #9673 (b6365) - Show a better error if there is a pending dynamic import - by @sheremet-va in #9676 (7ef5c)
- Preserve stack trace of
resolves/rejectschained assertion error - by @hi-ogawa in #9679 (c6151) - Handle module-sync condition in vmThreads/vmForks require - by @lesleh in #9650 and #9651 (bb203)
- Hooks should respect
maxConcurrency- by @hi-ogawa in #9653 (16d13) - Recursively autospy module object - by @hi-ogawa in #9687 (695a8)
- Remove trailing spaces from diff error log - by @hi-ogawa and @sheremet-va in #9680 (395d1)
- Respect project
resolve.conditionsfor externals - by @hi-ogawa in #9717 (1d498) - Use object for WeakMap instead of a symbol to support webcontainers - by @sheremet-va in #9731 (c5225)
- Fix re-mocking virtual module - by @hi-ogawa in #9748 (3cbbb)
- Cancelling should stop current test immediately - by @AriPerkkio in #9729 (0cb2f)
- Make
mockObjectchange backwards compatible - by @sheremet-va in #9744 (84c69) - browser:
- Remove
--remote-debugging-addressfrom chrome args - by @hi-ogawa and @AriPerkkio in #9712 (f09bb) - Make sure userEvent actions support
ensureAwaited- by @sheremet-va in #9732 (97685)
- Remove
- reporter:
dotreporter leaves pending tests - by @AriPerkkio in #9684 (4d793)
- runner:
- Mark repeated tests as finished on last run - by @AriPerkkio in #9707 (cc735)
- types:
bench.reportersno longer gives type errors when passing file name string paths - by @Bertie690 in #9695 (093c8)