vitest
Set up Vitest testing in any project — detects type (Cloudflare Workers, React, Node, library), generates vitest.config.ts, test setup, utilities, and a sample test. Covers mocking patterns, coverage config, workspace setup, Jest migration. Use whenever the user mentions adding tests, setting up Vitest, configuring tests, migrating from Jest, fixing testing infrastructure, or asks 'how do I test this'.
npx skills add jezweb/claude-skills --skill vitest --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Vitest Setup Detect the project type, generate the right Vitest configuration, and produce working test infrastructure. Not a reference card — this skill creates files. ## Workflow 1. **Detect** — scan the project to determine type and existing setup 2. **Configure** — generate vitest.config.ts tailored to the environment 3. **Scaffold** — create test setup, utilities, and a sample test 4. **Wire up** — add package.json scripts and TypeScript config ## Step 1: Detect Project Type Read these files to determine the project: ``` package.json → dependencies, scripts, type field tsconfig.json → paths, compiler options wrangler.toml → Cloudflare Workers project vite.config.ts → existing Vite setup (extend, don't replace) vitest.config.ts → already configured? just fill gaps jest.config.* → migration candidate src/ → source structure ``` Classify as one of: | Type | Signals | Environment | |------|---------|-------------| | **Cloudflare Workers** | wrangler.toml, @cloudflare/workers-types, cloudflare vite plugin | `node` with Workers-specific setup | | **React (Vite)** | @vitejs/plugin-react, react-dom | `jsdom` or `happy-dom` | | **React (SSR/TanStack Start)** | @tanstack/start, vinxi
- Workflow
- Step 1: Detect Project Type
- Step 2: Install Dependencies
- Step 3: Generate vitest.config.ts
- Cloudflare Workers
- React (Vite)
- Node / Hono API
- With Coverage (add to any config)
- Step 4: Generate Test Setup File
- Step 5: Add TypeScript Config
- Step 6: Add Package.json Scripts
- Step 7: Generate Sample Test
- For a Hono API route (e.g. src/routes/health.ts):
- For a React component (e.g. src/components/Button.tsx):
Base (always) pnpm add -D vitest React projects — add jsdom and Testing Library pnpm add -D @vitest/coverage-v8 jsdom @testing-library/react @testing-library/jest-dom @testing-library/user-event Workers projects — add Cloudflare test utilities pnpm add -D @vitest/coverage-v8 @cloudflare/vitest-pool-workers Node/Hono projects pnpm add -D @vitest/coverage-v8 If migrating from Jest, also remove: pnpm remove jest ts-jest @types/jest jest-environment-jsdom babel-jest
What does the vitest skill do?
Set up Vitest testing in any project — detects type (Cloudflare Workers, React, Node, library), generates vitest.config.ts, test setup, utilities, and a sample test. Covers mocking patterns, coverage config, workspace setup, Jest migration. Use whenever the user mentions adding tests, setting up Vitest, configuring tests, migrating from Jest, fixing testing infrastructure, or asks 'how do I test this'.
How do I install it?
Run `npx skills add jezweb/claude-skills --skill vitest --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From jezweb/claude-skills, a repository with 954 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
