Defining Projects in Vitest
From the Vitest cheat sheet ยท Test Projects ยท verified Nov 2026
Defining Projects
Split tests into named projects with their own environment, include, and browser settings
typescript
export default defineConfig({
test: {
projects: [
{ test: { name: 'unit', include: ['src/**/*.unit.test.ts'], environment: 'node' } },
{ test: { name: 'dom', include: ['src/**/*.dom.test.ts'], environment: 'jsdom' } },
],
},
})
// vitest run -p unit๐ v5: inline projects inherit the root config by default
โ ๏ธ Arrays merge, so a project's setupFiles add to the root ones
๐ก Every project needs a unique name; set one on inline configs
๐ Root-only options like reporters and coverage can't go in a project
projectsworkspaceconfig
Continue with Vitest
Save the full cheat sheet or work through every related task.