What problem does it solve?
Testing across a software project often lacks consistent guidance on where to place tests and how to structure mocks per architectural layer. This Skill codifies layer-specific testing strategies aligned with Clean Architecture to guide Domain, Application, Infrastructure, and Presentation testing considerations.
Core Features & Use Cases
- Domain Layer (
src/domain): Type: Pure Unit Tests. Mocks: ❌ NONE. Focus: validate business logic, input schemas (e.g., .parse()), and small utilities.
- Application Layer (
src/application): Type: Unit Tests. Mocks: ✅ Mock Infrastructure Repositories and Zustand Stores. Focus: test query options, complex hook logic, and state mutations.
- Infrastructure Layer (
src/infrastructure): Type: Integration Tests. Mocks: ✅ Mock HTTP; Focus: verify repositories call endpoints, map DTOs to domain entities, and validate API shapes.
- Presentation Layer (
src/presentation): Type: Component Integration Tests. Mocks: ✅ Mock Application Layer Hooks. Forbidden: ❌ Never mock axios, fetch, or useQuery directly in components. Focus: test UI rendering across data states, interactions, and accessibility.
Quick Start
Describe and enforce layer-specific testing strategies across domain, application, infrastructure, and presentation layers during development.