| name | testing |
| description | Use when creating, updating, reviewing, or debugging tests, unit tests, integration tests, E2E tests, mocks, test coverage, regressions, or verification steps. |
Testing
Use this skill for focused, useful, and project-consistent tests.
Rules
- Follow the project’s existing test framework, folder structure, naming, and patterns.
- Do not add a new test library, runner, mock system, or E2E tool unless already used or explicitly requested.
- Test behavior, not implementation details.
- Prioritize critical paths, regressions, security-sensitive logic, and business rules.
- Keep tests deterministic and isolated.
- Avoid brittle snapshots unless the project already uses them well.
- Mock external services safely.
- Do not hit real payment, email, SMS, storage, or production APIs in tests.
- Preserve existing test style and conventions.
- Avoid unrelated refactors.
Inspect First
Before changing tests, check existing patterns for:
- test framework
- test location
- naming style
- mock strategy
- fixtures/factories
- integration test setup
- E2E setup
- coverage expectations
- CI commands
Implementation Checklist
- Identify the behavior being tested.
- Reuse existing helpers, factories, mocks, and fixtures.
- Add the smallest useful test set.
- Cover success and important failure paths.
- Cover authorization, validation, and edge cases when relevant.
- Mock external dependencies.
- Keep tests readable.
- Run the most relevant test command.
Test Types
Use the right level:
- Unit tests for pure logic and services.
- Integration tests for API, database, and multi-layer behavior.
- E2E tests for critical user flows.
- Regression tests for fixed bugs.
- Security tests for access control, validation, and isolation.
Must Cover When Relevant
- validation failure
- unauthenticated access
- forbidden access
- not found
- conflict/business rule failure
- happy path
- async failure
- retry/idempotency
- tenant/user isolation
- sensitive data not exposed