Review Test Quality
Review workflow for evaluating test effectiveness
CLAUDE.md
When reviewing tests in a PR:
- Check that tests cover the actual behavior change, not just that code runs without errors.
- Check test names: do they describe the expected behavior? Would a failing test name tell you what broke?
- Check for missing edge cases: empty inputs, nulls, boundary values, error paths.
- Check test independence: does each test set up its own state? Would tests pass in random order?
- Check assertions: are they specific? “expect(result).toEqual({…})” is better than “expect(result).toBeTruthy()”.
- Check for over-mocking: are internal modules mocked when they could be tested directly?
- Verify tests aren’t just snapshots of current behavior disguised as meaningful assertions.
Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.