What problem does it solve?
This Skill establishes a robust testing methodology for Domain-Driven Design (DDD) backend applications, ensuring critical business logic is thoroughly validated and preventing regressions. It enforces strict coverage requirements and promotes a Test-Driven Development (TDD) approach.
Core Features & Use Cases
- Layered Testing: Guides on creating unit tests for Domain Entities and Value Objects (100% coverage mandatory), Application Layer handlers (95%+ coverage), and integration tests for critical workflows.
- TDD Workflow: Promotes a Red-Green-Refactor cycle, ensuring tests are written before implementation, leading to more reliable and well-documented code.
- Coverage Enforcement: Defines strict code coverage thresholds for different layers, integrated into
jest.config.js and CI/CD pipelines.
- Use Case: When developing a new DDD bounded context, use this Skill to structure your test suite, write comprehensive tests for your domain logic, and ensure high code quality before deployment.
Quick Start
To test a new domain entity, create a *.spec.ts file in tests/unit/domain/entities/ and write a failing test for a business method. Then, implement the minimal code to make the test pass, and refactor while keeping the test green.