Skip to content

Upgrading @vitest/coverage-v8 4 to 5

Breaking4.1.12 → 5.0.5Breaking65Security6Platform1New66Changed56Fixed289Other1

BreakingUpgrade verdict

65 breaking changes and a platform requirement change and 6 security fixes.

  • Screenshots and other test attachments are now saved in a different default folder.
  • Old import paths that were already deprecated have been deleted.
  • Vitest no longer searches parent folders for a config file.
  • The webdriverio integration package has been deleted.
Top 5 of 72 that need code or config changes

Adds @vitest/istanbul-lib-coverage ^1.0.2, @vitest/istanbul-lib-report ^1.0.2.

Drops @vitest/utils, istanbul-lib-coverage, istanbul-lib-report, istanbul-reports.

Installs 19 packages in all (was 28).

Breaking65
Changes the default attachmentsDir from .vitest-attachements/ to .vitest/attachments/.
attachmentsDir
Removes deprecated entry points.
Stops looking up the config file from ancestor directories.
Removes the webdriverio package.
webdriverio
Inline projects now extend the root config by default.
Parses files statically in vitest list by default.
vitest list
Enables locators.exact by default in browser mode.
locators.exact
Defaults blob reporter and --merge-reports to .vitest/blob/.
blob--merge-reports
Writes json and junit reporter output files to .vitest by default.
jsonjunit
Changes html reporter default output to .vitest.
html
Removes the broken "./src/*" export from package.json.
./src/*
Writes json and junit reporter output files to .vitest by default.
jsonjunit.vitest
Stops looking up the config file from ancestor directories.
Enables locators.exact by default in browser mode.
locators.exact
Makes the blob reporter and --merge-reports default to .vitest/blob/.
blob--merge-reports
Refactors caching, fixes : in project names, and changes the shape of the results cache.
results
Replaces loupe.inspect with pretty-format for value formatting.
loupe.inspectpretty-format
Removes quotes from string values in test.for/each title $ variable substitution.
test.fortest.each
Removes the sequential test and suite options in favor of concurrent.
sequentialconcurrent
Represents locators as objects instead of strings.
locator
Inlines the expect package into Vitest.
expect
Makes expect.poll fail when the function does not resolve in time.
expect.poll
Throws an error when hoistable methods are used outside the top level scope.
Makes toHaveTextContent strict and adds toMatchTextContent as an alternative.
toHaveTextContenttoMatchTextContent
Inlines the @vitest/runner package and stops publishing it.
@vitest/runner
Allows mutating the happy-dom/jsdom window object.
window
Exposes concurrencyId and workerId on TestModule diagnostics and makes the id 1-based.
concurrencyIdworkerIdTestModule
Adds a screenshotDirectory config to browser.expect.toMatchScreenshot.
screenshotDirectorybrowser.expect.toMatchScreenshot
Updates @sinonjs/fake-timers and adds support for mocking Temporal.
@sinonjs/fake-timersTemporal
Clears mocks by default before each test.
Stops emitting localStorage warnings on Node 26 and fails gracefully when a worker fails to start.
localStorage
Separates config resolution from server creation.
Enables mocking Temporal without fake timers.
Temporal
Adds support for nested projects.
Uses > as separator in -t and calculates only once.
-t
Shares the Vite server between inline projects.
Rewrites the public benchmark API.
Changes iframe scale in browser mode.
Requires sessionId for orchestrator HTML requests.
sessionId
Saves failure screenshots in attachmentsDir.
attachmentsDir
Makes coverage include/exclude globs less eager.
includeexclude
Allows thresholds.perFile to accept an object.
thresholds.perFile
Fixes toThrow("") behavior by reverting #6710.
toThrow()
Deserializes automock as automock in the mocker.
Adds better promise support in expects and matchers.
Hardens UI API access.
Enables mocking Temporal without fake timers.
Temporal
Browser failure screenshots are saved in attachmentsDir.
attachmentsDir
Adds better promise support in expects and matchers types.
Updates @sinonjs/fake-timers and adds support for mocking Temporal.
@sinonjs/fake-timersTemporal
Hardens UI API access.
Allows mutating the happy-dom/jsdom window object.
Requires sessionId for the browser orchestrator HTML request.
sessionId
Allows coverage thresholds.perFile to accept an object.
thresholds.perFile
Rewrites the public benchmark API.
Fails expect.poll when the function did not resolve in time.
expect.poll
Removes the sequential test and suite options in favor of concurrent.
sequentialconcurrent
Deserializes automock as automock in the mocker.
mocker
Replaces loupe.inspect with pretty-format for value formatting.
loupe.inspectpretty-format
Changes iframe scale behavior in browser mode.
Fixes coverage include/exclude globs being too eager, changing which files are covered.
includeexclude
Fixes toThrow("") behavior by reverting #6710.
toThrow
Fails the test when an asynchronous assertion is not awaited.
Preserves class mock prototype methods on instances.
Spy preserves class mock prototype methods on instances.
Security6
Fixes shell injection safety via github.ref_name in the publish workflow.
github.ref_name
Escapes inline orchestrator scripts in the browser mode.
Disables the client cdp API when allowWrite/allowExec is false in the browser mode.
cdpallowWriteallowExec
Restricts redirect mocks to the fs allowlist.
Requires authentication for coverage report and all UI subtree requests.
Requires auth for coverage report and all UI subtree requests.
Platform1
Requires Node.js 22 and Vite 6.4.

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • changed: const default: CoverageProviderModule → const default: CoverageProviderModule & { extendedContextCoverageDir?: string; session?: unknown | null }
  • added: property ScriptCoverageWithOffset.isExtendedContext?: boolean