Agent skill

testing-tdd-london-error-handling

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

Stars 4
Forks 4

Install this agent skill to your Project

npx add-skill https://github.com/vamseeachanta/workspace-hub/tree/main/.claude/skills/_archive/development/testing/testing-tdd-london/error-handling

SKILL.md

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
});

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results