What problem does it solve?
This Skill helps identify and prevent common testing anti-patterns that undermine test effectiveness, create brittle tests, or pollute production code. It ensures your test suite provides genuine confidence and contributes positively to code quality and development speed.
Core Features & Use Cases
- Avoid Mock-Centric Testing: Guides on ensuring tests verify real code behavior rather than merely asserting on mock interactions, preventing false positives.
- Pure Production Code: Enforces keeping production code free from test-only methods or properties, maintaining clean architecture and preventing accidental misuse.
- Thoughtful Mocking Strategies: Provides guidance on understanding dependencies before mocking, creating complete mock data structures, and recognizing when mocks signal deeper architectural issues.
- Use Case: When reviewing a test that asserts on the presence of a
sidebar-mock element, use this skill to identify it as an anti-pattern and refactor it to test the actual rendering and behavior of the sidebar component.
Quick Start
Apply the Testing Anti Patterns skill to review the 'UserSession' test suite, identifying any assertions that test mock behavior instead of actual session functionality, and suggest refactoring.