What problem does it solve?
Inconsistent or brittle frontend tests cause wasted time and fragile CI results; this Skill provides a clear, repeatable testing specification for projects using Vitest with Vue Test Utils to reduce flakiness and improve maintainability.
Core Features & Use Cases
- Configuration guidance: Recommended vitest.config settings such as globals, jsdom environment, aliasing, and coverage filters to standardize test runs.
- Test structure & naming: Enforces AAA (Arrange-Act-Assert), one behavior per test, file naming alongside source files, and include patterns for discoverability.
- Vue and composable testing patterns: Best practices for mounting components, using data-testid selectors, testing composables (including lifecycle hooks), and mounting with global plugins like Pinia and router.
- Mock strategies & stability: Module mocking, API and timer mocks, Pinia test helpers, and guidance to avoid implementation-detail assertions and overuse of snapshots.
- Use case: Apply these conventions when adding unit tests for components, composables, and stores to ensure consistent CI results and easier code reviews.
Quick Start
Run the vitest skill to apply the recommended Vitest configuration, naming conventions, and mock strategies to a Vue project.