Improve Test Quality
Target: $ARGUMENTS
If no argument provided, scan the full test suite.
Step 1: Gather Requirements
- Run test suite to establish baseline:
The status is captured before the pipe, because a pipeline reports its LAST stage's exit code —status=0 bun run test >test.log 2>&1 || status=$? tail -n 20 test.log; echo "exit=$status"tailalways succeeds, so a failing run reads asexit=0(falsifiable-checks, pager-shadowed status).|| status=$?rather than; status=$?: underset -ethe;form exits before the assignment, so the failure is never reported at all. - Scan test files for quality issues:
- Weak assertions (
toBeTruthy,toBeDefinedinstead of specific values) - Missing edge cases (no boundary values, no error paths)
- Implementation coupling (testing internals rather than behavior)
- Missing error path coverage
- Duplicated setup that could indicate missing abstractions
- Weak assertions (
- Identify 10-20 test files with highest improvement potential, noting:
- File path
- Issues found (weak assertions, missing edge cases, etc.)
- Estimated impact of improvement
Step 2: Compile Brief and Delegate
Compile the gathered information into a structured brief:
Improve test quality across the test suite.
Test files needing improvement (ordered by impact):
1. [test file] - [issues found]
- Weak assertions: [count]
- Missing edge cases: [description]
- Implementation coupling: [description]
2. ...
Verification: `bun run test` -> Expected: All tests pass, improved assertions and coverage
Invoke /lisa:implement with this brief to create the implementation plan.