reviewing-vitest-config
Review Vitest configuration for deprecated patterns and best practices. Use when reviewing test configuration or vitest setup.
When & Why to Use This Skill
This Claude skill automates the technical review of Vitest configuration files to ensure compliance with Vitest 4.x best practices. It proactively identifies deprecated patterns—such as obsolete thread management and coverage settings—and provides actionable remediation steps to optimize test execution performance and maintainability.
Use Cases
- Migrating projects to Vitest 4.x by automatically detecting and replacing deprecated configuration keys like maxThreads, singleThread, and legacy coverage options.
- Standardizing testing environments across monorepos by validating that all workspace and project configurations follow the latest recommended patterns.
- Optimizing CI/CD pipeline performance by ensuring efficient worker allocation and pool configuration in vitest.config.ts.
- Troubleshooting browser-based testing setups by verifying correct package imports and provider function calls for Playwright or WebdriverIO integrations.
| name | reviewing-vitest-config |
|---|---|
| description | Review Vitest configuration for deprecated patterns and best practices. Use when reviewing test configuration or vitest setup. |
| review | true |
| allowed-tools | [Read, Grep, Glob] |
Reviewing Vitest Config
This review skill validates Vitest configurations for deprecated patterns and best practices specific to Vitest 4.x.
Review Scope
This skill reviews:
- Pool configuration options
- Coverage configuration
- Workspace/project setup
- Browser mode configuration
- Dependency configuration
- Reporter configuration
- Import paths in test files
Quick Review Checklist
Pool Configuration
- No
maxThreadsormaxForks(usemaxWorkers) - No
singleThreadorsingleFork(usemaxWorkers: 1, isolate: false) - No nested
poolOptions(flatten to top-level)
Coverage Configuration
- Has explicit
coverage.includepatterns - No
coverage.ignoreEmptyLines - No
coverage.all - No
coverage.extensions
Workspace/Projects
- No
defineWorkspace(usedefineConfigwithprojects) - No
poolMatchGlobsorenvironmentMatchGlobs
Browser Mode
- Provider imported from package
- Provider is function call:
playwright() - Uses
instancesarray, notbrowser.name - Test files use
vitest/browser, not@vitest/browser/context
Dependencies
- Dependencies under
server.deps, not top-leveldeps
Other
- No
reporters: ['basic'](usedefault+summary: false) - No
VITE_NODE_DEPS_MODULE_DIRECTORIESin env - No
vitest/executeimports
Common Issues
Issue: maxThreads/maxForks Used
Finding:
test: {
maxThreads: 4,
}
Severity: Critical
Remediation:
test: {
maxWorkers: 4,
}
Issue: Missing coverage.include
Finding:
coverage: {
provider: 'v8',
}
Severity: Critical
Remediation:
coverage: {
provider: 'v8',
include: ['src/**/*.{ts,tsx}'],
}
Issue: defineWorkspace Used
Finding:
import { defineWorkspace } from 'vitest/config';
export default defineWorkspace([...]);
Severity: Critical
Remediation:
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
projects: [...],
},
});
Issue: Wrong Browser Import
Finding:
import { page } from '@vitest/browser/context';
Severity: Critical
Remediation:
import { page } from 'vitest/browser';
Issue: Browser Provider Not Function
Finding:
browser: {
provider: 'playwright',
name: 'chromium',
}
Severity: Critical
Remediation:
import { playwright } from '@vitest/browser-playwright';
browser: {
provider: playwright(),
instances: [{ browser: 'chromium' }],
}
Issue: deps Not Under server
Finding:
test: {
deps: {
inline: ['vue'],
},
}
Severity: Deprecated
Remediation:
test: {
server: {
deps: {
inline: ['vue'],
},
},
}
Review Workflow
Step 1: Find Config Files
glob "vitest.config.{ts,js,mts,mjs}"
glob "vite.config.{ts,js,mts,mjs}"
Step 2: Check Pool Options
Search for deprecated options:
grep -E "(maxThreads|maxForks|singleThread|poolOptions)" vitest.config.ts
Step 3: Check Coverage
Verify include patterns:
grep -A 10 "coverage:" vitest.config.ts | grep "include:"
Step 4: Check Workspace
Search for deprecated workspace:
grep "defineWorkspace" vitest.config.ts
Step 5: Check Browser Mode
Verify provider and instances:
grep -A 5 "browser:" vitest.config.ts
Step 6: Check Test Files
Find wrong imports:
grep -r "@vitest/browser/context" tests/
For detailed review workflow, see references/review-workflow.md
Review Output Format
# Vitest Configuration Review
## Summary
- Config files reviewed: X
- Test files reviewed: Y
- Critical issues: Z
- Deprecated patterns: W
- Best practice suggestions: V
## Critical Issues
### 1. [File]: [Issue]
**Pattern:** [Code snippet]
**Problem:** [Description]
**Remediation:** [Fix]
## Deprecated Patterns
### 1. [File]: [Issue]
**Pattern:** [Code snippet]
**Problem:** [Description]
**Remediation:** [Fix]
## Best Practices
### 1. [File]: [Suggestion]
**Current:** [Code snippet]
**Suggestion:** [Improvement]
For reviewing test quality beyond configuration, use the reviewing-test-quality skill for patterns on coverage, React 19 APIs, and anti-patterns.
References
For detailed information:
- Deprecated Patterns - Complete list with examples
- Review Workflow - Step-by-step review process
For migration guide, see @vitest-4/skills/migrating-to-vitest-4
For configuration patterns, see @vitest-4/skills/configuring-vitest-4
For complete API reference, see @vitest-4/knowledge/vitest-4-comprehensive.md