What problem does it solve?
This Skill solves the problem of writing and maintaining reliable Go unit-test mocks when a consumer needs to stub interface dependencies in a consistent, type-safe way.
Core Features & Use Cases
- Consumer-side interface mock flow: defines a minimal interface in the package that consumes it, then generates mocks from the root configuration.
- Mockery v3 + testify integration: produces testify-based mocks with
EXPECT() and the New<Type>(t) constructor for mockery v3.
- Guardrails and validation: ensures you use the project’s centralized
.mockery.yml and validates generated output via a post-check script.
- Run-time return logic: uses
RunAndReturn for typed results derived from call arguments.
Quick Start
Run x-mockery to generate a testify mock for a consumer-side interface using the root .mockery.yml, then verify the result with scripts/check-mockery-targets.sh.