vitest-unit-testing
Installation
SKILL.md
Unit testing with Vitest
This skill provides patterns and conventions for writing comprehensive unit tests in TypeScript projects using Vitest.
When to use this skill
- Writing unit tests for TypeScript utilities, services, or API clients
- Testing stores (Pinia, Zustand, etc.)
- Testing API transforms and services
- Adding test coverage to existing code
- Debugging failing tests
Test file structure
Location and naming
- Place tests in
__tests__/directory next to the file being tested - Name test files with
.test.tssuffix matching the source file name - Example:
config.ts→__tests__/config.test.ts