What problem does it solve?
This guide provides a structured approach to separating business logic from system interactions in TypeScript, enabling cleaner architecture and easier testing.
Core Features & Use Cases
- Identify system boundaries between business logic and external calls (I/O, HTTP, shell, DB) in TypeScript.
- Define a conventional interface contract (e.g., I{Name}) and the corresponding domain interface file.
- Implement a thin wrapper (domain.system.ts) that delegates to external dependencies.
- Create a mock implementation for testing under tests/mocks/.
- Refactor business logic to depend on the interface via dependency injection.
- Improve test coverage by exercising the interface-based design and mocks.
- Configure tooling to exclude the system wrapper from test coverage.
Quick Start
Identify a mixed area of business logic and system interactions, create an interface, implement a thin system wrapper, and refactor the code to depend on the interface.