Skip to content
Back to skills

Mock Management

ASecurity

Sub-skill of testing-tdd-london: Mock Management (+2).

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
testingtypescriptgotesting

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill mock-management --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mock Management?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mock Management
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-mock-management/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-mock-management)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-tdd-london-mock-management
description: 'Sub-skill of testing-tdd-london: Mock Management (+2).'
version: 1.0.0
category: development
type: reference
scripts_exempt: true
---

# Mock Management (+2)

## Mock Management

- Keep mocks simple and focused on single behavior
- Verify interactions, not implementation details
- Use `jest.fn()` for behavior verification
- Avoid over-mocking internal details
- Reset mocks between tests


## Contract Design

- Define clear interfaces through mock expectations
- Focus on object responsibilities and collaborations
- Use mocks to DRIVE design decisions
- Keep contracts minimal and cohesive


## Common Pitfalls


```typescript
// BAD: Over-mocking internal details
const mock = {
  _internalState: {},
  _privateMethod: jest.fn()  // Don't mock private methods
};

// GOOD: Mock only public interface
const mock = {
  publicMethod: jest.fn().mockReturnValue(expectedResult)
};

// BAD: Verifying too many implementation details
expect(mock.method).toHaveBeenCalledTimes(3);  // Fragile

// GOOD: Verify essential behavior
expect(mock.method).toHaveBeenCalledWith(expectedArgs);
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.