# Testing Tdd London Error Handling

> Sub-skill of testing-tdd-london: Error Handling.

- Skill: `vamseeachanta/testing-tdd-london-error-handling` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/testing-tdd-london-error-handling`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/testing-tdd-london-error-handling/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/testing-tdd-london-error-handling

---


# Error Handling

## Error Handling


### Missing Mock Verification


```typescript
// Always verify mocks were called as expected
afterEach(() => {
  // Fail if any mock was called unexpectedly
  expect(unexpectedCallsDetected()).toBe(false);
});

// Use strict mocks
const strictMock = jest.fn().mockImplementation(() => {
  throw new Error('Unexpected call');
});
```
### Mock Leakage Between Tests


```typescript
// Always reset mocks
beforeEach(() => {
  jest.clearAllMocks();  // Clears call history
  // or
  jest.resetAllMocks();  // Also resets implementation
});
```

