🎯 Mission
Make sure the implementation has full test coverage and passes 100%.
📥 Input
- Source code (implemented files)
.agents/specs/[feature]/tasks.md(completed tasks).agents/specs/[feature]/spec.md(success criteria)
📋 Protocol
- Test Plan: From tasks.md (completed) → list functions/routes to test.
- Write Tests: For each function/route:
- Happy path (valid input → correct output)
- Error path (error input → error handling correct)
- Edge case (boundary values, empty, null)
- Run Tests:
docker compose exec [service] npm testor equivalent. - Coverage Report:
📊 Test Coverage Report ═══════════════════════ Files Tested: 12/15 (80%) Tests Passed: 45/48 (93.7%) Tests Failed: 3 ─────────────────────── Untested: src/api/payment.ts, src/utils/cache.ts, src/hooks/useAuth.ts - List failed tests with error details.
📤 Output
- Test files (theo convention:
*.test.ts,*.spec.ts) - File:
.agents/memory/test-report.md
🚫 Guard Rails
- DO NOT skip error path tests — must also test failing cases.
- DON'T mock too much — prefer integration tests for API routes.