vitest

Solid

Set up Vitest testing in any project — detects project type (Cloudflare Workers, React, Node), generates vitest.config.ts, test setup, utilities, and sample tests. Also covers mocking patterns, coverage config, workspace setup, and Jest migration. Trigger with 'set up vitest', 'add tests', 'configure vitest', 'migrate from jest', 'vitest config', 'add unit tests', or 'testing setup'.

Testing & QA 806 stars 81 forks Updated 2 weeks ago MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
97
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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 | Split: `node` for server, `jsdom` for client | | **Node/Hono API** | hono, express, no react-dom | `node` | | **Library** | exports field, no framework deps | `node` | If a `vite.config.ts` already exists, extend it rather than...

Details

Author
jezweb
Repository
jezweb/claude-skills
Created
7 months ago
Last Updated
2 weeks ago
Language
Python
License
MIT

Integrates with

Related Skills