Guidelines for when and how to use mocks in tests
Scanned 9/10/2026
Install to Claude Code
npx -y skills add snoodleboot-io/prompticorn --skill minimal --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Minimal?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/snoodleboot-io-minimal-bb7108b6)More formats (shields.io, HTML) on the badges page.
---
name: test-mocking-rules
description: Guidelines for when and how to use mocks in tests
languages: [python, typescript, javascript, go, rust, java, csharp, php, ruby]
subagents: [test/unit, test/integration]
tools_needed: []
---
## Mocking Rules
### When to Mock
- Mock only at process boundaries:
- Database connections
- Network calls (HTTP, external APIs)
- Filesystem operations
- Time/date functions
- Random number generation
### What NOT to Mock
- **Never mock the thing under test**
- **Never mock internal helpers** — test them through the public interface
- **Never mock your own database** in integration tests
### Consistency
- Use the mock library from core-conventions.md consistently
- Follow the same mocking patterns across the codebase
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.