nest-service-test
Writes the service layer tests of a use case (UC-XXX) in a NestJS application with Vitest: every business rule with its allowed and its rejected case, every alternative flow the service decides, and the main success scenario, called on the real service against a real PostgreSQL database in Testcontainers, nothing mocked in the call chain. Checks the Vitest transformer that decorator metadata needs, and owns the shared test setup and the per-use-case seed test/data/uc<id>-<slug>.ts. Files are test/UC-XXX-<slug>.service-spec.ts. Use when the user asks to "test the service layer", "test the business rules", "write service tests", or mentions NestJS testing, Vitest, Testcontainers, domain errors, or business rule tests for a NestJS use case. Run by /use-case-test as the integration layer of a use case offered through the service alone, or when the service layer is named; below a REST entry layer the API tests cover the service. Can also be run directly.
Pinned to revision 648476b42261, so it is the text this page describes rather than whatever the author pushed since.
Files
- skills/nest-service-test/SKILL.md
- skills/nest-service-test/references/markers.md
- skills/nest-service-test/references/test-setup.md
Every link opens the file at its source, pinned to the revision this page describes.