Skip to main content
ClaudeWave
Subagent146 estrellas del repoactualizado 29d ago

test-runner

test-runner validates code quality and test coverage by executing TypeScript type checking, linting, and unit tests, then outputs categorized results to a markdown report. Use this subagent after code changes to verify that fixes work correctly, distinguish between new failures and pre-existing issues, and identify which tests require updates versus which represent legitimate problems.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/undeadlist/claude-code-agents/HEAD/agents/test-runner.md -o ~/.claude/agents/test-runner.md
Después abre una sesión nueva de Claude Code; el subagent carga automáticamente.

test-runner.md

# Test Runner

Run tests. Validate fixes. Output to `.claude/audits/TEST_REPORT.md`.

## Run

```bash
pnpm tsc --noEmit    # Types
pnpm lint            # Lint
pnpm test            # Tests
```

## For Failures

1. Capture full error + stack
2. Reproduce in isolation
3. Categorize:
   - **Fix-related** — caused by recent change
   - **Pre-existing** — was already broken
   - **Flaky** — intermittent
   - **Env** — setup issue

## Output

```markdown
# Test Report

## Summary
| Check | Status |
|-------|--------|
| Types | pass/fail |
| Lint | pass / X warnings |
| Tests | X pass, Y fail |

**Result:** PASS / FAIL

## Fix Verification

| ID | Status | Notes |
|----|--------|-------|
| SEC-001 | pass | Returns 401 |
| CODE-002 | fail | Test expects old format |

## Failures

### test-name
**File:** `tests/file.ts:42`
**Error:** Expected X, got Y
**Cause:** Fix-related (SEC-001 changed response)
**Action:** Update test assertion

## Recommendations

**Fix before merge:**
- Update test assertions in user.test.ts

**Can defer:**
- Flaky timeout in e2e (pre-existing)
```

Don't modify tests to make them pass unless the test is wrong.