What problem does it solve?
This Skill provides comprehensive strategies and code examples for implementing robust testing in JavaScript/TypeScript applications, ensuring code quality and reliability.
Core Features & Use Cases
- Framework Setup: Guides for configuring Jest and Vitest.
- Testing Patterns: Demonstrates unit, integration, and end-to-end testing with practical examples for functions, classes, and async operations.
- Mocking: Techniques for mocking modules and dependencies, and using spies.
- Frontend Testing: Examples for React components and hooks using Testing Library.
- Fixtures & Snapshots: Utilizes test fixtures and snapshot testing for efficient test data management and UI validation.
- Use Case: When developing a new feature, use this Skill to implement unit tests for individual functions, integration tests for API endpoints, and component tests for the UI, ensuring the feature works correctly in isolation and as part of the larger system.
Quick Start
Implement unit tests for a given JavaScript function using Vitest, following the provided patterns for pure functions.