vitest-skill
Generates Vitest tests in JavaScript/TypeScript with Vite-native speed. Jest-compatible API with ESM support and HMR. Use when user mentions "Vitest", "vi.mock", "vitest.config". Triggers on: "Vitest", "vi.mock", "vi.fn", "Vite test", "vitest config".
npx skills add sickn33/agentic-awesome-skills --skill vitest-skill --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 Testing Skill ## When to Use Use this skill when you need generates Vitest tests in JavaScript/TypeScript with Vite-native speed. Jest-compatible API with ESM support and HMR. Use when user mentions "Vitest", "vi.mock", "vitest.config". Triggers on: "Vitest", "vi.mock", "vi.fn", "Vite test", "vitest config". ## Core Patterns ### Basic Test ```typescript import { describe, it, expect, vi, beforeEach } from 'vitest'; import { Calculator } from './calculator'; describe('Calculator', () => { let calc: Calculator; beforeEach(() => { calc = new Calculator(); }); it('adds two numbers', () => { expect(calc.add(2, 3)).toBe(5); }); it('throws on divide by zero', () => { expect(() => calc.divide(10, 0)).toThrow(); }); }); ``` ### Mocking (vi instead of jest) ```typescript import { vi } from 'vitest'; // Mock module vi.mock('./database', () => ({ getUser: vi.fn().mockResolvedValue({ name: 'Alice' }), saveUser: vi.fn().mockResolvedValue(true), })); // Mock function const mockFn = vi.fn(); mockFn.mockReturnValue(42); mockFn.mockResolvedValue({ data: 'test' }); // Spy const spy = vi.spyOn(console, 'log').mockImplementation(() => {}); expect(spy).toHaveBeenCalledWith('message'); spy.mockR
- When to Use
- Core Patterns
- Basic Test
- Mocking (vi instead of jest)
- In-Source Testing
- Snapshot Testing
- React Component Testing
- Anti-Patterns
- Quick Reference
- vitest.config.ts
- Deep Patterns → reference/playbook.md
- Limitations
What does the vitest-skill skill do?
Generates Vitest tests in JavaScript/TypeScript with Vite-native speed. Jest-compatible API with ESM support and HMR. Use when user mentions "Vitest", "vi.mock", "vitest.config". Triggers on: "Vitest", "vi.mock", "vi.fn", "Vite test", "vitest config".
How do I install it?
Run `npx skills add sickn33/agentic-awesome-skills --skill vitest-skill --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 sickn33/agentic-awesome-skills, a repository with 44,414 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.