testdoubles
Use when: selecting stubs, mocks, fakes, or spies for test isolation and deterministic behavior.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when: selecting stubs, mocks, fakes, or spies for test isolation and deterministic behavior.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when running workspace tests, choosing a test command, or summarizing results before handoff to debugger.
Use when running workspace tests, choosing a test command, or summarizing results before handoff to debugger.
Use when: running pre-commit or pre-push CI-equivalent checks in any workspace — discovers workflow commands with Cursor tools, filters for local executability, scopes to staged changes, and runs checks cheapest-first.
Use when the user wants to install or customize cursorAssistant in the current project (GitHub install or configure).
Use when: running pre-commit or pre-push CI-equivalent checks in any workspace — discovers workflow commands with Cursor tools, filters for local executability, scopes to staged changes, and runs checks cheapest-first.
Use when: discovering package manifests, assessing dependency health, finding replacements, or confirming import usage before removal — discovery only; mutating installs are handled by the deps agent.
| name | testDoubles |
| description | Use when: selecting stubs, mocks, fakes, or spies for test isolation and deterministic behavior. |
| type | reference |
| version | 1.0 |
| license | MIT |
Skill metadata: version "1.0"; tags [tdd, test-doubles, mocking]; recommended tools [].
Use this skill in workspaces with the tdd pack selected.
Choose the right test double for the job. The wrong double makes tests brittle; the right one makes them fast and deterministic.
| Kind | What it does | Use when |
|---|---|---|
| Dummy | Passed but never used | Satisfying a parameter list when the argument doesn't matter |
| Stub | Returns pre-programmed values | Isolating the unit from a dependency's return value |
| Fake | Working implementation with shortcuts | Replacing a heavy dependency (e.g., an in-memory DB instead of a real one) |
| Spy | Records calls; optionally stubs | Verifying that a dependency was called correctly |
| Mock | Pre-programmed with call expectations | Strictly verifying interaction contracts with a dependency |
FakeUserRepository, StubMailer, SpyAuditLog.If changing an implementation detail (not the public contract) breaks a test that uses a mock, the mock is over-specified. Replace it with a stub or a spy asserting only the observable outcome.