Migrate from Vitest 2.x/3.x to 4.x with pool options, coverage config, workspace to projects, and browser mode updates. Use when upgrading Vitest versions or encountering deprecated patterns.
This skill guides migration from Vitest 2.x/3.x to 4.x, focusing on breaking changes and deprecated patterns.
Vitest 4.0 introduces breaking changes in:
Before (Vitest 3.x):
export default defineConfig({
test: {
maxThreads: 4,
singleThread: true,
},
});
After (Vitest 4.x):
export default defineConfig({
test: {
maxWorkers: 4,
maxWorkers: 1,
isolate: false,
},
});
Before (Vitest 3.x):