mock-factory
CommunityCentralize test mocks to reduce duplication.
Authorjrmatherly
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Duplicate mocks across many unit tests make maintenance painful and error-prone; a centralized mock factory reduces toil by providing a single source of truth for mocks.
Core Features & Use Cases
- Create a factory function that returns a complete mock implementing all interface methods with vi.fn()
- Accept optional overrides for any method to customize behavior per test
- Use in tests by replacing ad-hoc mocks with the generated factory to ensure consistency across suites
Quick Start
Generate a new mock factory in tests/helpers and replace existing mocks with the factory to standardize mocks across tests.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: mock-factory Download link: https://github.com/jrmatherly/shipit/archive/main.zip#mock-factory Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.