migrating-to-vitest-4

Migrate Vitest configurations from 2.x/3.x to 4.x.

Updated Nov 21, 2025
One-click install
npx skills add https://github.com/djankies/claude-configs --skill migrating-to-vitest-4
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrating-to-vitest-4
Source: https://github.com/djankies/claude-configs/tree/main/vitest-4/skills/migrating-to-vitest-4
Command: npx skills add https://github.com/djankies/claude-configs --skill migrating-to-vitest-4

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides migrating from Vitest 2.x/3.x to 4.x, covering pool options, coverage config, workspace-to-projects, browser mode updates, and server namespace changes.

Core Features & Use Cases

  • Update package, config, and project structures for Vitest 4.x.
  • Adjust test pool, coverage, workspace, and browser provider configurations.
  • Update test files and imports to align with new architecture.

Quick Start

Upgrade your Vitest setup by following the 4.x migration steps and verify with a full test run.

Frequently Asked Questions about migrating-to-vitest-4

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate my Vitest configuration from 2.x or 3.x to 4.x?

Migrate Vitest 2.x/3.x to 4.x by updating config keys like maxWorkers, include, and projects; replacing workspace with projects; updating server.deps; and adjusting pool and coverage settings. Follow step-by-step before/after examples for each change, then run your full test suite to verify.

What changed in Vitest 4.x pool options and browser mode configuration?

Vitest 4.x updates pool options for test execution and browser provider imports. Browser mode now requires new provider import paths. Review the migration table for specific pool type changes and update your browser configuration to use the new import structure.

Do I need to update my test files when upgrading to Vitest 4.x?

Yes, test files may require updates to align with Vitest 4.x architecture changes, particularly imports and browser provider references. The migration guidance covers concrete before/after file examples and per-project adjustment workflows.

What dependencies need to change for Vitest 4.x browser providers?

Browser provider dependencies and their imports change in Vitest 4.x. Install updated provider packages and adjust your imports to match the new structure. The migration covers dependency version updates and new import paths for each provider.

How do I convert Vitest workspace configuration to 4.x projects format?

Replace workspace with projects in your Vitest 4.x config and restructure project definitions accordingly. The migration provides direct before/after configuration examples showing how to map workspace entries to the new projects array format.

What server namespace changes should I address in Vitest 4.x?

Vitest 4.x updates the server namespace, including server.deps configuration keys. Review the migration table for all server-related key changes and update your vite.config or vitest.config accordingly.