What problem does it solve?
This Skill promotes a "no-mock" testing strategy for hexagonal architecture, ensuring that domain logic is isolated and tested against real infrastructure via service containers. It leads to more reliable, representative tests and reduces the fragility of mock-heavy test suites.
Core Features & Use Cases
- Absolute Constraints: Strictly forbids mocking frameworks (
jest.mock, vi.mock, sinon.stub) and encourages testing against real service containers.
- Port & Adapter Pattern: Guides on defining clear port interfaces (contracts) and implementing concrete adapters for various infrastructure concerns (databases, blob storage, external APIs).
- Service Container Setup: Provides patterns for configuring PostgreSQL and MinIO via
process-compose (local development) and GitHub Actions services (CI/CD) for consistent test environments.
- Use Case: A developer needs to test a new database interaction. Instead of mocking the database, they can use this skill to set up a real PostgreSQL container via
process-compose, write an integration test that uses the actual database adapter, and verify the interaction against a live service.
Quick Start
Refactor the 'UserRepository' to use a 'DatabasePort' interface and implement a 'PostgresAdapter' that connects to a real PostgreSQL instance, ensuring no mocking is used in tests.