testing-typescript-services
Installation
SKILL.md
Testing TypeScript Services
When to use
- Adding tests for services or use-cases
- Refactoring untestable code
- Designing the test strategy for a feature
Core rules
- Unit tests for domain entities and value objects (no mocks, pure assertions)
- Use-cases tested with hand-rolled fakes (not jest.mock)
- Integration tests for infrastructure adapters (real or test DB)
- Contract tests for ports (ensure adapters satisfy interface)
- No test logic in production code; no
if (process.env.NODE_ENV === 'test')