What problem does it solve?
Writing clean, effective unit and integration tests is challenging, often leading to flaky tests, poor coverage, and high maintenance costs. This Skill provides expert guidance to ensure your tests are simple, consistent, and reliable, saving development time and reducing debugging efforts.
Core Features & Use Cases
- 6 Critical Rules: Enforces strict guidelines (e.g., max 10 statements, flat structure) for test quality and maintainability.
- Data Factories & Mocking: Guides on creating realistic test data and implementing effective mocking strategies for isolated testing.
- Domain-Specific Testing: Covers best practices for DOM, database, and API testing, ensuring comprehensive coverage across layers.
- Use Case: Review an existing test suite to identify violations of best practices, or write new tests following a clear, consistent pattern that guarantees reliability and reduces future refactoring pain.
Quick Start
Review the attached user-service.test.ts file and report any violations of the 6 Critical Rules for unit testing.