| name | test |
| description | Create and run tests with coverage analysis (Tester Agent) |
🧪 TESTER AGENT
Test request:
Task: {{args}}
MODE DETECTION
| Mode | Trigger | Description |
|---|
| RUN | default | Run full test suite |
| FIX | "fix", "failing", "broken" | Auto-fix failing tests |
| COVERAGE | "coverage", "gaps" | Analyze coverage gaps |
| WRITE | "write", "create", "add" | Generate new tests |
FRAMEWORK DETECTION
Automatically detect and run according to the project:
| Framework | Detection | Command |
|---|
| Jest | package.json has jest | npm test |
| Vitest | vitest.config.* | npm run test |
| pytest | pytest.ini / pyproject.toml | pytest -v |
| Flutter | pubspec.yaml | flutter test |
| Go | go.mod | go test ./... |
RUN MODE (Default)
1. Detect Framework
[test command]
2. Coverage Report
| Metric | Value | Default Target | Critical Code Target |
|---|
| Statements | X% | 80% | 90% |
| Branches | X% | 75% | 85% |
| Functions | X% | 80% | 90% |
| Lines | X% | 80% | 90% |
Target Guidelines:
- Standard code: 80%
- Payment/Finance: 90%+
- Security/Auth: 90%+
- Core business logic: 85%+
- UI components: 60-70%
3. Test Results
✅ Passed: X tests
❌ Failed: Y tests
⏭️ Skipped: Z tests
⏱️ Duration: Xs
4. Coverage Gaps
⚠️ Uncovered areas:
src/file.ts lines 45-52
src/other.ts function handleError
FIX MODE
When there are failing tests:
Failed Test Analysis
Test: [test name]
Error: [error message]
File: [file:line]
Root Cause
[Why it fails]
Fix
[old code]
[fixed code]
COVERAGE MODE
Gap Analysis
| File | Coverage | Missing |
|---|
file.ts | 65% | Lines 10-15, 45-50 |
util.ts | 45% | Functions: parse, validate |
Recommendations
- Add test for
[function]
- Cover edge case:
[scenario]
WRITE MODE
Generate tests for:
Test File Structure
describe('[Component/Function]', () => {
describe('[Method]', () => {
it('should [expected behavior]', () => {
});
it('should handle [edge case]', () => {
});
it('should throw on [error condition]', () => {
});
});
});
CI/CD JSON OUTPUT
{
"passed": 42,
"failed": 0,
"skipped": 2,
"coverage": 85.5,
"duration": "12.3s",
"timestamp": "2024-12-14T19:00:00Z"
}
PRO TIPS
- 80%+ on critical paths - no need for 100%
- Zero flaky tests - better to remove than keep flaky
- Fail fast - run
/test before starting new work
- >60s = optimize - slow tests need attention
Key Takeaway: Test execution isn't about 100% coverage - it's about 80%+ on critical paths with zero flaky tests.