Skip to content

feat: 30 - test mocking patterns - #32

Merged
miroslavpojer merged 5 commits into
masterfrom
feature/30---Add-skill---test-mocking-patterns
Aug 18, 2026
Merged

feat: 30 - test mocking patterns#32
miroslavpojer merged 5 commits into
masterfrom
feature/30---Add-skill---test-mocking-patterns

Conversation

@miroslavpojer

Copy link
Copy Markdown
Contributor

Adds the test-mocking-patterns skill — a focused reference for test double selection and implementation across Python, TypeScript/JavaScript, and Scala.

What it covers

  • Double classification — when to use stub, mock, spy, fake, or dummy based on the nature of the dependency interaction (return value vs side effect vs unused)
  • Pythonpytest-mock / unittest.mock: patch targets, scope and cleanup, responses / pytest-httpx for HTTP stubbing, freezegun for time control, monkeypatch / patch.dict for env vars
  • TypeScript / Jest — module mocking, hoisting behaviour, clearAllMocks / resetAllMocks / restoreAllMocks, spy vs mock distinction
  • Scala / mockito-scala — stub, mock, spy, fake patterns with reset guidance
  • Diagnostics — wrong patch target, mock state bleed, over-specified assertions, private-method testing antipattern, stub returning wrong type
  • Don't mock what you don't own — guidance on wrapping third-party types in a thin protocol before mocking

What's included

Path Description
skills/test-mocking-patterns/SKILL.md Skill body
skills/test-mocking-patterns/evals/evals.json Eval cases (happy path, regression, negative)
skills/test-mocking-patterns/evals/trigger-eval.json Trigger boundary evals
skills/test-mocking-patterns/evals/fixture-map.md Maps eval cases to source fixtures
skills/test-mocking-patterns/evals/files/ Source fixtures used by evals
docs/test-mocking-patterns.md User-facing doc page

Closes #30

@miroslavpojer

Copy link
Copy Markdown
Contributor Author

As there is no free reviewer and low impact I am doing force merge.

@miroslavpojer
miroslavpojer merged commit cb89973 into master Aug 18, 2026
1 check passed
@miroslavpojer
miroslavpojer deleted the feature/30---Add-skill---test-mocking-patterns branch August 18, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add skill - test-mocking-patterns

1 participant