
Vitest Testing Patterns
You're writing tests with Vitest and React Testing Library, and this gives you the patterns to do it right. It covers the practical stuff: mocking API routes and database calls, testing React components with user interactions, handling chained mocks for Drizzle ORM, and organizing test files in a Next.js project. The examples show real scenarios like authentication checks, error states, and timer mocking. It's opinionated about file structure and pairs well with E2E testing skills since unit tests are just one layer. If you're already using Vitest but keep googling how to mock that one thing, this consolidates those patterns in one place.
- skills.sh installs
- 252
- GitHub stars
- 113
- last updated
- Jun 3, 2026
Install
$ npx -y skills add erichowens/some_claude_skills --skill vitest-testing-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Vitest Testing Patterns
This skill helps you write effective tests using Vitest and React Testing Library following project conventions.
When to Use
✅ USE this skill for:
- Writing unit tests for utilities and functions
- Creating component tests with React Testing Library
- Setting up mocks for API calls, databases, or external services
- Integration testing patterns
- Understanding test coverage and CI setup
❌ DO NOT use for:
- Jest-specific patterns → similar but check Jest docs for differences
- End-to-end testing → use Playwright or Cypress skills
- Performance testing → use dedicated performance tools
- API contract testing → use OpenAPI/Pact patterns
Test Infrastructure
Configuration: vitest.config.ts
- Environment: jsdom
- Setup file:
src/test/setup.ts - Coverage: v8 provider
Commands:
npm test # Watch mode
npm run test:run # Single run
npm run test:coverage # With coverage
File Organization
Sponsors
Details
- Repository
- github.com/erichowens/some_claude_skills
- Category
- Testing & QA
- First seen
- Jun 3, 2026
More from erichowens/some_claude_skills
All 73- Photo Content Recognition Curation Expert227
- Web Design Expert226
- Adhd Daily Planner215
- Voice Audio Engineer210
- Typography Expert202
- Admin Dashboard200
- Data Viz 2025198
- Geospatial Data Pipeline197
- Sound Engineer182
- Document Generation Pdf172
- Crisis Response Protocol163
- Refactoring Surgeon161
- Agent Creator158
- Dark Mode Design Expert155
- Computer Vision Pipeline153
- Ux Friction Analyzer152
- Wisdom Accountability Coach152
- Fullstack Debugger148
- Hand Drawn Infographic Creator148
- Partner Text Coach148
- Job Application Optimizer147
- Tech Entrepreneur Coach Adhd147
- Neobrutalist Web Designer146
- Color Contrast Auditor144