What problem does it solve?
This Skill helps developers avoid common mistakes when writing tests, ensuring that tests verify actual behavior rather than mock implementations, and preventing the pollution of production code with test-specific methods.
Core Features & Use Cases
- Mock Behavior Prevention: Guides users to test real component behavior instead of just verifying mock existence.
- Production Code Purity: Discourages adding test-only methods to production classes, promoting cleaner code.
- Informed Mocking: Emphasizes understanding dependencies before mocking to prevent tests from breaking due to incorrect mock configurations.
- Use Case: When writing tests for a new feature, this skill ensures you're not just testing that your mock API client returns a specific JSON, but that your application correctly handles the data from a real (or realistically mocked) API response.
Quick Start
Use the testing-anti-patterns skill to review your test suite and identify any assertions made directly on mock objects.