| name | testing-standards |
| description | Testing philosophy and standards for the teensyrom-nx Angular workspace, covering Clean Architecture layers (domain, infrastructure, application, features, UI, utils), mock contract standards (Partial<IContract> via injection tokens), test description naming, and test commands. Use when writing or reviewing unit/integration tests, deciding what to mock versus test for a given layer, designing behavioral tests for an NgRx Signal Store, facade, or context service in the application layer, testing an Angular smart/feature component in libs/features, or establishing testing conventions before implementing a new service, store, or component. |
Testing Standards Skill
Testing philosophy, standards, and methodology for the teensyrom-nx Angular workspace, aligned with Clean Architecture.
When to Use This Skill
- Writing or reviewing unit/integration tests for any architectural layer
- Deciding what to mock and what to test for real (mock boundary questions)
- Designing behavioral tests for an NgRx Signal Store, facade, or context service (application layer)
- Testing an Angular smart/feature component (
libs/features)
- Applying mock contract standards or test description naming conventions
- Understanding the workspace's test commands and coverage targets
Testing Strategy by Layer
| Layer | Location | Testing Approach | Mock Boundary |
|---|
| Domain | libs/domain | Don't test contracts/models. Test domain logic. | N/A - Interfaces used as mocks |
| Infrastructure | libs/infrastructure | Unit test in isolation | Mock generated API clients |
| Application | libs/application | Behavioral - integrate stores/services | Mock infrastructure only |
| Features | libs/features | Unit test - Mock the application layer. | |
| UI Components | libs/ui | Unit test | |
| Utilities | libs/utils | Unit test | |
Key Principle: Mock only at infrastructure boundaries. Application and features layers integrate real stores, services, and application logic together.
Choosing the Right Reference
Mock Contract Standards (Quick Reference)
All mocks MUST use domain contracts/interfaces, typed as Partial<IContract>, provided via injection tokens - never ad-hoc object literals or inline types. See references/TESTING_STANDARDS.md for the full rationale and examples.
Test Commands
npx nx test
npx nx test application
npx nx test --coverage
npx nx e2e teensyrom-ui-e2e
Related Skills
run-unit-tests - executes the unit/integration test suite and produces a baseline report
run-e2e-tests - executes Cypress E2E tests