74 lines
1.7 KiB
Markdown
74 lines
1.7 KiB
Markdown
---
|
|
name: test-plan
|
|
description: Create a test strategy for a feature — test types, coverage targets, mocking approach, and CI integration.
|
|
disable-model-invocation: true
|
|
argument-hint: "[feature-name]"
|
|
context: fork
|
|
agent: test-engineer
|
|
---
|
|
|
|
# Test Plan
|
|
|
|
Create a test strategy for `$ARGUMENTS`.
|
|
|
|
## Steps
|
|
|
|
1. **Understand the feature:**
|
|
- Read relevant code and documentation
|
|
- Identify critical paths (auth, payments, data mutations)
|
|
- Map dependencies (APIs, databases, external services)
|
|
|
|
2. **Read project context:**
|
|
- `RECOMMENDATIONS.md` — testing stack, coverage targets
|
|
- `docs/backend/security.md` — security-critical flows that need tests
|
|
- Existing test infrastructure and patterns
|
|
|
|
3. **Design the strategy:**
|
|
|
|
## Output Format
|
|
|
|
```markdown
|
|
# Test Plan: [feature name]
|
|
|
|
## Scope
|
|
[What is being tested and why]
|
|
|
|
## Test Types
|
|
|
|
### Unit Tests
|
|
- What: [functions, components, utilities]
|
|
- Tools: Vitest + Testing Library
|
|
- Coverage target: [%]
|
|
- Key scenarios: [list]
|
|
|
|
### Integration Tests
|
|
- What: [API routes, DB operations, service interactions]
|
|
- Tools: Vitest + MSW / Testcontainers
|
|
- Key scenarios: [list]
|
|
|
|
### E2E Tests
|
|
- What: [critical user journeys]
|
|
- Tools: Playwright
|
|
- Key scenarios: [list]
|
|
|
|
## Mocking Strategy
|
|
| Dependency | Mock Approach | Justification |
|
|
|------------|--------------|---------------|
|
|
|
|
## Test Data
|
|
- Factories: [what needs factories]
|
|
- Fixtures: [static test data]
|
|
- Seeds: [database seeds if needed]
|
|
|
|
## Edge Cases & Error Paths
|
|
- [list of scenarios to cover]
|
|
|
|
## CI Integration
|
|
- PR: [what runs, time budget]
|
|
- Main: [what runs, time budget]
|
|
- Artifacts: [traces, screenshots, coverage reports]
|
|
|
|
## Risks
|
|
- [What could go wrong, flake risks, external dependencies]
|
|
```
|