test-review
Test Review
Three defects, in the order they matter:
- Tautology — the assertion cannot fail, so the test is green forever.
- Incompleteness — the assertion can fail, but passes over regressions a stronger one would catch.
- Coupling — the assertion is strong and meaningful, but written against internals, so it breaks every time the implementation is improved.
The first two decide whether a test catches bugs. The third decides whether the codebase stays safe to change. Fix a tautology before bothering to strengthen a subset assertion — there is no point tightening an assertion that was never load-bearing.
Target
Scope comes from $ARGUMENTS: a path, commit, range, branch, or PR number; empty means uncommitted changes plus the current branch's diff vs its base. For a single commit, compare against its first parent. --fix anywhere in the args applies findings after reporting; otherwise report only.
Review test files only — *.spec.*, *.test.*, __tests__/**, and the project's equivalents. Never flag production code. Report only tests the change added or touched; a pre-existing test elsewhere is out of scope, and when one genuinely blocks reading a new one, say so as a note.
1. Tautology
Flag any assertion whose outcome does not depend on the code under test. A tautological test is worse than no test: it manufactures confidence and survives real regressions untouched.