mock-factory

Installation
SKILL.md

Mock Factory

Generates a typed, reusable factory function for mocking a module, class, or interface — with per-test override support and clean reset semantics.


Phase 1: Discovery

Before writing anything, extract:

  1. Target shape — is it a TS interface, class, or CommonJS/ESM module?
  2. Test runner — Jest or Vitest? (API is nearly identical; note differences inline)
  3. Override depth — do tests need to override individual method return values, or whole sub-objects?
  4. Async surface — are any methods async or returning Promise?
  5. Reset strategy — per-test (beforeEach) or per-file (beforeAll)?

If the user pastes the interface/class, extract the shape directly. If not, ask for it.


Related skills

More from blunotech-dev/agents

Installs
1
GitHub Stars
2
First Seen
Apr 22, 2026