Upgrading @vitest/ui 3 to 4
Breaking3.2.7 → 4.1.12Breaking35Security2Platform3Deprecated5New122Changed53Fixed360Other3
BreakingUpgrade verdict
32 breaking changes and 3 platform requirement changes and 2 security fixes.
In plain terms
- Renames collect to import and removes prepare.
- The minWorkers option is gone; in non watch mode the minimum is now 0 automatically.
- The simple built-in 'basic' test reporter is no longer available.
- The default set of files excluded from test runs is now simpler, which may change which files are picked up.
Must act Top 5 of 42 that need code or config changes
@vitest/ui publishes an official migration guide for version 4. It covers more than the release notes do.
Migration guide ↗What you must change
Breaking32
Renames collect to import and removes prepare.
collectimportprepareRemoves minWorkers and sets it automatically to 0 in non watch mode.
minWorkersRemoves the 'basic' reporter.
basicSimplifies the default exclude pattern.
Removes the deprecated getSourceMap API.
getSourceMapRemoves the UserConfig type in favor of ViteUserConfig.
UserConfigViteUserConfigRemoves deprecated coverage options in favor of vitest/node exports.
vitest/nodeRemoves deprecated typecheck and runner types.
Removes Node types from the main entry point, use vitest/node instead.
vitest/nodeRemoves support for Vite 5.
Removes deprecated types.
Removes deprecated environmentMatchGlobs and poolMatchGlobs options.
environmentMatchGlobspoolMatchGlobsRemoves the deprecated workspace option in favor of projects.
workspaceprojectsRemoves deprecated reporter APIs.
Removes the ast export from utils.
astRemoves coverage .all and reworks include/exclude.
.allincludeexcludeRewrites the spying implementation to make module mocking more intuitive.
Replaces the deprecated ErrorWithDiff with TestError.
ErrorWithDiffTestErrorRemoves deprecated internal helpers and environment exports.
Ignores --standalone when a CLI filename filter is used.
--standaloneUses module-runner instead of vite-node.
module-runnervite-nodeIncludes shadow root contents in pretty-format output.
Removes the deprecated order option from the test() API.
test()orderBrowser mode now requires a provider factory instead of a provider string.
browser.providerPasses current equality testers to asymmetric matchers.
expectProjects only accept files with vitest.config or vite.config in the name.
projectsvitest.configvite.configSupports spying on classes.
spyV8 coverage now supports only AST based remapping.
V8Verbose reporter prints tests in a list and introduces a tree reporter.
verbosetreeRewrites the test pools without tinypool.
tinypoolSets mode to todo when no function is passed to test or describe.
testdescribetodoFails tests with obsolete snapshots on CI.
Security2
Restricts redirect mocks to the fs allowlist.
Bumps flatted and removes version pinning to resolve flatted's CVE related issues.
flattedPlatform3
Updates Vite's peer dependency range in mocker.
Updates the
engines field to drop Node 18 support.enginesUpdates
@types/node peer dependencies.@types/nodeDeprecations to plan for
Deprecated5
Deprecates several vitest/* entry points.
Deprecates unused types in the matcher context.
Deprecates
toBe* spy assertions in favor of toHaveBeen* and toThrowError.toBe*toHaveBeen*toThrowErrorLogs a deprecation warning when
test.poolOptions is set.test.poolOptionsBrowser mode inherits the
isolate option and deprecates browser.isolate and browser.fileParallelism.isolatebrowser.isolatebrowser.fileParallelismAPI changes
Generated by DepDelta from published .d.ts files. Not mixed with prose notes.
- changed:
const default: (ctx: Vitest) => Plugin → const default: (ctx: Vitest) => Vite.Plugin