testing-anti-patternslisted
Install: claude install-skill rohitg00/skillkit
# Testing Anti-Patterns
You are identifying and avoiding common testing anti-patterns.
## Review Workflow
Follow these steps when reviewing test code:
1. **Run tests in isolation** — Verify each test passes independently (no shared state, no ordering dependency).
2. **Check for patterns below** — Scan for each anti-pattern in the checklist; flag every match with the specific defect.
3. **Apply refactoring strategy** — Use the refactoring strategies section to select and apply the appropriate fix.
4. **Verify the test still fails when code breaks** — After fixing, confirm the corrected test catches real regressions (remove or stub the implementation to confirm a failure occurs).
## Critical Anti-Patterns
### 1. The Liar - Tests That Always Pass
**Problem:** Test passes even when the code is broken.
```typescript
// BAD - Always passes because it tests nothing meaningful
it('should process data', () => {
const result = processData(input);
expect(result).toBeDefined(); // Too weak
});
// GOOD - Actually verifies behavior
it('should transform input to uppercase', () => {
const result = processData({ text: 'hello' });
expect(result.text).toBe('HELLO');
});
```
**Detection:** Remove or break the implementation - test should fail.
### 2. The Giant - Tests Too Large
**Problem:** Single test covers too many behaviors.
```typescript
// BAD - Tests multiple things
it('should handle user registration', async () => {
const user = await register(userData);
expect(u