Generates mocks, stubs, and spies for unit testing by automatically analyzing code dependencies and framework requirements.
The Test Double Generator skill streamlines the unit testing process by automatically creating mocks, stubs, spies, and fakes to isolate code units. By analyzing existing code and dependencies, it generates framework-specific doubles for popular tools like Jest and Sinon, significantly reducing the manual effort required to write robust test suites. Whether you need to simulate API responses or track object interactions, this skill provides ready-to-use code snippets that ensure high-quality, isolated testing.
Key Features
01Automated dependency analysis
023 GitHub stars
03Framework-specific code generation for Jest and Sinon
04Direct code insertion via CLI commands
05Context-aware test isolation logic
06Support for mocks, stubs, spies, and fakes
Use Cases
01Mocking external API calls to simulate various response scenarios
02Stubbing service dependencies to isolate business logic during unit tests
03Implementing spies to track and verify interactions with real objects