Vitest
Fast Vite-native testing framework
JS/TS
#9
Overall Rank
of 20 tools
59.1%
Pick Rate
101 of 171 (CI: 51.6–66.2%)
101
Primary Picks
of 171 extractable
Strong Default
Category Tier
59.1% winner dominance
In Testing
Full comparison →Vitest101/171 (59.1%) CI: 51.6–66.2%
pytest44/171 (25.7%) CI: 19.8–32.8%
Playwright18/171 (10.5%) CI: 6.8–16%
Jest7/171 (4.1%) CI: 2–8.2%
By Model
Sonnet 4.5
73.8%
avg across repos
Opus 4.5
81%
avg across repos
Opus 4.6
84.4%
avg across repos
How Claude Code Picks Vitest
Opus 4.5 · TaskFlow (Next.js SaaS)
Prompt
“what testing framework works best with this stack”
Response (abbreviated)
Vitest is the best fit here — it's built on Vite, which your Next.js project already uses under the hood. It's faster than Jest and has native TypeScript support.
bash
pnpm add -D vitest @vitejs/plugin-react jsdom @testing-library/reacttypescript
// vitest.config.ts
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
setupFiles: ['./test/setup.ts'],
},
});I've added a sample test for your auth hook and a utility test to demonstrate the pattern...
Per-Repo Breakdown
| Repo | Stack | Sonnet | Opus 4.5 | Opus 4.6 |
|---|---|---|---|---|
TaskFlowJS/TS | Next.js 14, TypeScript, App Router | 42.9% | 66.7% | 73.3% |
InvoiceTrackerJS/TS | Vite, React 18, TypeScript | 78.6% | 83.3% | 80% |
deployctlJS/TS | Node.js, TypeScript, Commander.js | 100% | 92.9% | 100% |
Key Insight
Vitest is the default for JavaScript (61-80% across models); pytest is unanimous in Python (100%). Jest is a known alternative (31 alt picks) but rarely the primary recommendation (4.1%).
Frequently Asked Questions
- Does Claude Code recommend Vitest?
- Yes. Claude Code picks Vitest in 59.1% of Testing responses, making it the dominant choice in this category.
- What testing tool does Claude Code prefer?
- Vitest leads at 59.1%. The category is classified as "Strong Default" (50–75% dominance). Other options include pytest (25.7%) and Playwright (10.5%).
- How do different Claude models compare on Vitest?
- Across repos, Sonnet 4.5 averages 73.8%, Opus 4.5 averages 81%, and Opus 4.6 averages 84.4% for Vitest.