Summary
Add a test-mocking-patterns skill that gives Copilot structured guidance on choosing, implementing, and reviewing test doubles (mocks, stubs, spies, fakes) across Python, TypeScript, and Scala.
Motivation
Three existing skills — test-unit-write, test-unit-standards, and test-unit-review — all explicitly redirect mocking questions to a test-mocking-patterns skill that does not yet exist. Users asking "how do I mock an HTTP client in pytest?", "should I use a spy or a stub here?", or "why is my mock not being called?" fall into a gap with no skill to catch them.
Proposed scope
The skill should cover:
- Pattern selection — when to use a mock, stub, spy, fake, or dummy; decision table by dependency type (HTTP, DB, clock, env, file I/O, randomness)
- Implementation guidance — language-specific recipes:
- Python:
unittest.mock, pytest-mock, responses, freezegun
- TypeScript/Jest:
jest.fn(), jest.spyOn(), manual mocks, __mocks__ folder
- Scala/MUnit:
scalamock, mockito-scala
- Anti-patterns — over-mocking, mocking what you don't own, brittle
verify chains, leaking mock state between tests
- Boundary rules — what should never be mocked (pure functions, value objects, simple data classes)
- Interaction with
test-unit-write — the writer skill delegates Step 3 (mock strategy) here; this skill must be compatible with that handoff
Acceptance criteria
Related skills
test-unit-write (upstream delegator — Step 3)
test-unit-standards (peer — isolation rules)
test-unit-review (peer — flags mocking violations)
test-data-management (sibling new skill)
Summary
Add a
test-mocking-patternsskill that gives Copilot structured guidance on choosing, implementing, and reviewing test doubles (mocks, stubs, spies, fakes) across Python, TypeScript, and Scala.Motivation
Three existing skills —
test-unit-write,test-unit-standards, andtest-unit-review— all explicitly redirect mocking questions to atest-mocking-patternsskill that does not yet exist. Users asking "how do I mock an HTTP client in pytest?", "should I use a spy or a stub here?", or "why is my mock not being called?" fall into a gap with no skill to catch them.Proposed scope
The skill should cover:
unittest.mock,pytest-mock,responses,freezegunjest.fn(),jest.spyOn(), manual mocks,__mocks__folderscalamock,mockito-scalaverifychains, leaking mock state between teststest-unit-write— the writer skill delegates Step 3 (mock strategy) here; this skill must be compatible with that handoffAcceptance criteria
SKILL.mdwith frontmatter (name,description,license,compatibility)references/for at least Python and TypeScriptevals/evals.jsonwith ≥ 5 trigger and ≥ 3 body evalsNOT:pointers updated intest-unit-write,test-unit-standards, andtest-unit-reviewto reference this skill by nameRelated skills
test-unit-write(upstream delegator — Step 3)test-unit-standards(peer — isolation rules)test-unit-review(peer — flags mocking violations)test-data-management(sibling new skill)