vitest
Set up Vitest testing in any project — detects type (Cloudflare Workers, React, Node, library), generates vitest.config.ts, test setup, utilities, and a…
Skill by artubss
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/artubss-vitest
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, testing, devops, cloud
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/vitest
What's inside
- Skill name
vitest- Description
- 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'.
- License
- MIT
- Instructions
- 451 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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 creating a separate vitest.config.ts — Vitest reads Vite config natively.
## Step 2: Install Dependencies
Generate the install command based on detected type:
```bash
# 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
```
Use the project's package manager (check for pnpm-lock.yaml, yarn.lock, bun.lockb, or package-lock.json).
## Step 3: Generate vitest.config.ts
### Cloudflare Workers
```typescript
import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config";
export default defineWorkersConfig({
test: {
globals: true,
poolOptions: {
workers: {
wrangler: { configPath: "./wrangler.toml" },
},
},
},
});
```
If the project uses the Cloudflare Vite plugin (`@cloudflare/vite-plugin`), integrate into the existing vite.config.ts instead:
```typescript
/// <reference types="vitest/config" />
import { defineConfig } from "vite";
import { cloudflare } from "@cloudflare/vite-plugin";
export default defineConfig({
plugins: [cloudflare()],
test: {
globals: true,
},
});
```
### React (Vite)
```typescript
/// <reference types="vitest/config" />
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./src/test/setup.ts"],
css: true,
},
});
```
If a vite.config.ts already exists, add the `test` block to it rather than creating a new file.
### Node / Hono API
```typescript
import { defineConfig } from "vitest/config";From artubss/SKILLS-CLAUDE-CODE, MIT.
More from artubss/SKILLS-CLAUDE-CODE
- 0.542score
ux-compare
artubss
Compare UX patterns across multiple reference apps using pattern libraries produced by ux-extract.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
ux-audit
artubss
Walk through a live web app AS a real user to find usability + behavioural bugs that static reviews miss.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
favicon-gen
artubss
Generate custom favicons from logos, text, or brand colours.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
responsiveness-check
artubss
Test website responsiveness across viewport widths using browser automation.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
team-update
artubss
Post project updates to team chat, gather feedback, triage responses, and plan next steps.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
cloudflare-worker-builder
artubss
Scaffold and deploy Cloudflare Workers with Hono routing, Vite plugin, and Static Assets.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
d1-drizzle-schema
artubss
Generate Drizzle ORM schemas for Cloudflare D1 databases with correct D1-specific patterns.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
shadcn-ui
artubss
Install and configure shadcn/ui components for React projects.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
hono-api-scaffolder
artubss
Scaffold Hono API routes for Cloudflare Workers.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
project-health
artubss
All-in-one project configuration and health management.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
icon-set-generator
artubss
Generate cohesive, project-specific SVG icon sets for websites and applications.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
ux-extract
artubss
Exhaustively extract UX patterns from a reference web app.
SkillCFreshness: C★ 11Claude Code +9
Signals
- Stars
- 11
- Forks
- 3
- Open issues
- 0
- Last commit (this folder)
- May 16, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/artubss/SKILLS-CLAUDE-CODE
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from artubss
- 0.542score
favicon-gen
artubss
Generate custom favicons from logos, text, or brand colours.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
shadcn-ui
artubss
Install and configure shadcn/ui components for React projects.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
d1-drizzle-schema
artubss
Generate Drizzle ORM schemas for Cloudflare D1 databases with correct D1-specific patterns.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
hono-api-scaffolder
artubss
Scaffold Hono API routes for Cloudflare Workers.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
cloudflare-worker-builder
artubss
Scaffold and deploy Cloudflare Workers with Hono routing, Vite plugin, and Static Assets.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
icon-set-generator
artubss
Generate cohesive, project-specific SVG icon sets for websites and applications.
SkillCFreshness: C★ 11Claude Code +9
Cite this page
vitest skill. Agent Mart. https://agentmart.dev/skills/artubss-vitest (last updated 2026-10-24)