testing-patterns
Installation
SKILL.md
Testing Patterns — Cross-Stack Testing Mastery
Mandatory Pre-Flight Context Inspection
Before writing unit, integration, or component tests, you MUST inspect:
- AAA Pattern & Single Act Rule (Section 37) → Structure tests strictly as Arrange-Act-Assert; perform only 1 single action per test case
- Accessibility-First Query Hierarchy (Section 343) → Query React components by
getByRoleorgetByLabelText; ban defaultgetByTestIdqueries - Dependency Injection Over Global Mocks (Section 268) → Prefer constructor dependency injection over global
vi.mock()to prevent cross-test state leakage
Activation Boundaries
- Activate when: Operating in tasks requiring Testing mastery across stacks. Unit testing with Jest/Vitest/pytest, integration testing, E2E with Playwright, mocking strategies, test architecture (AAA, Given-When-Then), code coverage, snapshot testing, API testing, component testing with Testing Library, and TDD workflow. Use when writing tests, designing test architecture, or improving test coverage..
- DO NOT activate when: The task falls strictly outside testing-patterns domain or belongs to a different dedicated specialist.