What problem does it solve?
This Skill addresses the inconsistency and poor quality of unit tests by providing clear, comprehensive guidelines for structuring, naming, and implementing effective tests.
Core Features & Use Cases
- Test Naming and Structure: Enforces descriptive, action-oriented test names and consistent AAA organization.
- Mocking and Isolation: Guides proper use of Jest mocks, avoiding shared state, and isolating external dependencies for reliable tests.
- Async and React Testing: Provides best practices for testing asynchronous code, React components, and ensuring proper use of act().
- Coverage and Edge Cases: Ensures tests cover all code paths, including error handling, boundary cases, and complex scenarios.
- Tools and Conventions: Recommends using inline snapshots, proper element selection via testID, and avoiding brittle snapshot files.
- Robust Naming and Assertion: Promotes specific, clear assertions like
toBeOnTheScreen() and discourages weak assertions.
Quick Start
Write a test to verify that the function correctly returns false for invalid email input.