Upgrading @vitest/coverage-v8 1 to 2
Breaking1.6.1 → 2.1.9Breaking47Security4Deprecated2New90Changed21Fixed287Other1
SecurityPatches a security issue where Browser mode serves arbitrary files (CVE-2025-24963).CVE-2025-24963 ↗
BreakingUpgrade verdict
40 breaking changes and 4 security fixes.
In plain terms
- TypeScript users referencing `sequence.concurrent` on `RuntimeConfig` will see a type error.
- Removes the --segfault-retry flag; the forks pool is now the recommended default.
- Renames the none provider to preview and makes it the default.
- Enables coverage.ignoreEmptyLines by default, which may significantly change coverage results versus v1.
Must act Top 5 of 46 that need code or config changes
@vitest/coverage-v8 publishes an official migration guide for version 2. It covers more than the release notes do.
Documentation ↗Adds tinyrainbow ^1.2.0.
Drops picocolors, strip-literal.
Installs 72 packages in all (was 41).
What you must change
Breaking40
Removes
sequence.concurrent from the RuntimeConfig type.RuntimeConfigsequence.concurrentRemoves the --segfault-retry flag; the forks pool is now the recommended default.
--segfault-retryRenames the none provider to preview and makes it the default.
nonepreviewEnables coverage.ignoreEmptyLines by default, which may significantly change coverage results versus v1.
coverage.ignoreEmptyLinesRemoves the watchExclude option.
watchExcludeChanges the default pool to 'forks' for compatibility, which may be slightly slower than threads.
poolRenames indexScripts to orchestratorScripts in the browser config.
indexScriptsorchestratorScriptsRemoves the empty suite from the runner.
Removes process.exit when a workspace project fails to be created.
process.exitRemoves deprecated options.
Removes the browser.fileParallelism option.
browser.fileParallelismRenames indexScripts to orchestratorScripts.
indexScriptsorchestratorScriptsRemove deprecated options.
Changes the default
pool option to 'forks'.poolRemoves the empty suite from the runner.
Removes the --segfault-retry option.
--segfault-retryEnables coverage.ignoreEmptyLines by default.
coverage.ignoreEmptyLinesRemoves the watchExclude option.
watchExcludeReverts support for Vite 6 because it introduced breaking changes; support will be enabled later.
vitevitestpnpm.overridesChanges how custom glob patterns in the workspace config are treated: any matching file is a Vitest config, any matching folder is a workspace project.
Treats any file matching the workspace glob as a Vitest config and any matching folder as a workspace project with regular config resolution.
vitest.config.tsvite.config.tsExplains that projects/* matches files and folders, while projects/**/* now matches every file inside projects, not only folders.
Notes that the workspace glob change does not affect non-glob usage.
Makes spec into a class instead of a tuple in the API.
Adds a meta field to the json output.
metaStops exiting the process when config loading fails.
Stops calling process.exit manually in the API.
process.exitStops exiting the process when global setup has failed.
Adds correct location and snapshot fields to the json reporter; location now requires includeTaskLocation.
locationincludeTaskLocationUpdates the chai dependency to v5.
chaiMakes --merge-reports support coverage.
--merge-reportsAdds support for concurrent suites.
--merge-reports now supports coverage.--merge-reportsRuns suite hooks in a stack.
Updates the chai dependency to v5.
chaiAdds a vitest list API to print collected tests without running them, changing the custom pool API.
vitest listcollectTestsrunTestsSimplifies mock function generic types and aligns them with jest.
Adds promise-based return assertions and stops auto-resolving returned promises in spy.mock.returns.
spy.mock.returnsspy.mock.settledResultsexpect().toHaveResolved()Runs suite hooks in a stack, which may make tests run slightly slower.
onTestFinishedStops adding test files to exclude patterns when coverage.exclude is overridden.
coverage.excludecoverageConfigDefaults.excludeSecurity4
Patches a security issue where Browser mode serves arbitrary files (CVE-2025-24963).
Patches a remote code execution issue when visiting a malicious website while the Vitest API server is listening (CVE-2025-24964).
Updates vulnerable test-exclude dependency to v7.
test-excludeUpdates the vulnerable test-exclude dependency to v7.
test-excludeDeprecations to plan for
Deprecated2
Deprecates UserConfig in favor of ViteUserConfig.
UserConfigViteUserConfigDeprecates old task types and node-reliant types.
API changes
Generated by DepDelta from published .d.ts files. Not mixed with prose notes.
- added:
const default: { startCoverage(): Promise<void>; takeCoverage(): Promise<{ result: any[] }>; stopCoverage(): Promise<void>; getProvider(): Promise<V8CoverageProvider> }
- changed:
const default: { getProvider(): Promise<V8CoverageProvider>; startCoverage(): void; takeCoverage(): Promise<unknown>; stopCoverage(): void } → const default: { startCoverage(): void; takeCoverage(): Promise<{ result: Profiler.ScriptCoverage[] }>; stopCoverage(): void; getProvider(): Promise<V8CoverageProvider> }
- removed:
method V8CoverageProvider.clean(clean?: boolean): Promise<void> - removed:
method V8CoverageProvider.onAfterSuiteRun({ coverage, transformMode, projectName }: AfterSuiteRunMeta): void - removed:
method V8CoverageProvider.reportCoverage({ allTestsRun }?: ReportContext): Promise<void> - removed:
method V8CoverageProvider.resolveOptions(): Options - removed:
property V8CoverageProvider.coverageFiles: Map<ProjectName, CoverageFilesByTransformMode> - removed:
property V8CoverageProvider.coverageFilesDirectory: string - removed:
property V8CoverageProvider.ctx: Vitest - removed:
property V8CoverageProvider.options: Options - removed:
property V8CoverageProvider.pendingPromises: Promise<void>[] - changed:
class V8CoverageProvider extends BaseCoverageProvider implements CoverageProvider → class V8CoverageProvider extends BaseCoverageProvider<ResolvedCoverageOptions<'v8'>> implements CoverageProvider - changed:
property V8CoverageProvider.name: string → property V8CoverageProvider.name: 'v8' - changed:
property V8CoverageProvider.testExclude: InstanceType<TestExclude> → property V8CoverageProvider.testExclude: InstanceType<typeof TestExclude> - added:
method V8CoverageProvider.createCoverageMap(): CoverageMap - added:
method V8CoverageProvider.generateCoverage({ allTestsRun }: ReportContext): Promise<CoverageMap> - added:
method V8CoverageProvider.generateReports(coverageMap: CoverageMap, allTestsRun?: boolean): Promise<void> - added:
method V8CoverageProvider.parseConfigModule(configFilePath: string): Promise<magicast.ProxifiedModule<any>> - added:
property V8CoverageProvider.version: string