@vitest/mocker
5.1.0 · 2 Nov 2026MIT190.8M / weekRepositoryHomepagenpmAtom feed
3.2.7 is the newest release of 3.x.
In short
5 breaking15 new24 fixed1 internal
- Breaking
There are a few breaking changes, but we expect the migration to be smooth.
- Breaking
spy.mockResetchanges - Breaking
Pass down context to test hooks
- Breaking
Support Vite 6
- Breaking
deps: Update fake-timers to v14.0.0
Security
2 advisories affect 3.0.0; 4.1.12 fixes them
- ModerateVitest: Code injection via unauthenticated manual mock registrationGHSA-qxg6-89mg-rqv8 · 21 Oct 2026Fixed in 4.1.12
- ModerateVitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect MockGHSA-82fw-gwwq-j7x9 · 8 Sep 2026Fixed in 4.1.11
Release note
The section about @vitest/mocker of a note shared by several packages.
Vitest 3 is here! There are a few breaking changes, but we expect the migration to be smooth. This release page lists all changes made to the project during the beta. For the migration guide, please refer to the documentation.
Breaking Changes
- Breaking
spy.mockResetchanges - Breaking
Pass down context to test hooks
- Breaking
Support Vite 6
- Breaking
deps: Update fake-timers to v14.0.0
Features
Support inline
diffoptions and supportprintBasicPrototypeAllow a custom note when calling
ctx.skip()dynamicallyAllow inline workspace configuration
Provide the current project to the global setup
Print project name as a label
Print a deprecation warning if suite or test uses object as the third argument
Expose versions from
vitest/nodeentry point and statically on Vitestdiff.printBasicPrototype: falseby defaultPrepare the Vitest API to be stable
Support Vite v6 in mocker package
Allow multi-browser configuration
Add resolved project names to the reporter API
Introduce the new reporter API
Add
describe.for
Bug Fixes
Misc fix for vite 6 ecosystem ci
Respect
cacheDirwhen optimizer is enabledReset runningPromise after
finallyin case there is an error to avoid it getting stuckRevert support for Vite 6
Support Node 21
Don't use
Customtype internallyPersist cli filters as watch mode file filter
Don't use dim color for succeeded tests
Fix missing chai types
cancelCurrentRunawaitsrunningPromiseAdd Locator typings for nth, first and last.
Batch console logs by microtask
Allow
getMockImplementationto return "once" implementationcapturePrintErrorlogger duplicate event handlersAllow slots in vitest-browser-vue
Reset root workspace project on restart
Cleanup
vitest/reportersentrypointColors on
forkspoolExport
VitestRunnertype fromvitest/runnersReturn test fn result to runner
Re-apply default conditions if using vite 6 or later
Prevent infinite loop on prettyDOM calls
deps: Update all non-major dependencies - in #7085
deps: Update all non-major dependencies - in #7116
types: Make parameters non-nullable for Playwright options
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.