@vitest/spy
5.0.5 · 15 Oct 2026MIT202.7M / weekRepositoryHomepagenpmAtom feed
5.0.5 is the newest release of 5.x.
In short
6 new2 faster39 fixed
Release note
Features
experimental: Tag cache directories with CACHEDIR.TAG
experimental: Support
test.ui.themeoptionexperimental: Highlight selector multiple matches in trace view
experimental: Print how many tests were affected and a total when running
--changedexperimental: Add an option to cache dependencies instead of statically parsing them
experimental: Add fit and zoom controls to trace viewer
Bug Fixes
Fail the run on git and location filter errors
Enable fsModuleCache by default
Track project files and mocks with --changed
Refactor caching, fix
:in project and change the shape ofresultscacheKeep full
$string values whentaskTitleValueFormatTruncateis 0Resolve node builtins in client environments
Fix module graph builtin externals after #11421
Wrap module mocks during in-source testing
Handle line endings in snapshot
Respect root in projects
Resolve mocks in directories with spaces
api: Publish the api token atomically
browser: Close the mock route interception race
browser: Allow toHaveTextContent without arguments
browser: Apply API options without browser config
browser: Preserve undefined command arguments
browser: Wait for setup mocks before importing a test file
browser: Avoid extra scroll outside the iframe
browser: Run browser instances as workers
⚠️ This can degrade performance if you have a custom
maxWorkerssetting. Previously, it was applied incorrectly and could lead to Vitest using too many resources. For example, a lower number would still open too many browsers. Fixing it means Vitest opens less instances by default now.
browser: Open one cdp session per tester
browser: Clean up unmocked and pending mocks
coverage: V8 browser memory leak between test files
coverage:
allowExternalfails to include uncovered filescoverage: Filenames containing brackets incorrectly showing as uncovered
coverage: Istanbul coverage wrong when module transform warmups
deps: Update all non-major dependencies
expect: Fix
MapandSetdeep equality in some assertionsexpect: Check value in chai-style returned
mocker: Fix native loader mocking edge cases
pretty-format: Support boxed symbols
reporters: Junit to strip ANSI sequences from all XML attributes
runner: Don't cache failed fixture setups
typecheck: Use typescript pool in toTestSpecification
ui: Remove duplicate browser-open call opening two tabs
ui: Simplify explorer filtering + fix nested tests when search matches a suite
ui: Store module graph once per environment
ui: Mount index.html handler on the ui base path
ui: Center split pane resize handle
vm: Bind
thistomodule.exports
Performance
Reuse fsModuleCache when filtering by source
spy: Reset only mocks that were called or reconfigured