What it does
A Cursor rules file for writing unit tests with Vitest in JavaScript and TypeScript projects. It asks the AI to focus on business logic and utilities, mock dependencies with vi.mock before imports, cover valid, invalid and edge-case inputs, and group tests in describe blocks with clear names.
Use cases
- 01Write tests for a utility function with edge cases
- 02Mock an API client before importing the module
- 03Group related tests with descriptive names