1.3 KiB
1.3 KiB
TESTS — F-001 Scaffold modular monolith skeleton
Unit / integration (Vitest)
src/modules/health/tests/health.test.ts: module-scoped; registers the module public API on a bare Fastify instance;GET /health→ 200 and{"status":"ok"}.src/app/tests/build-app.test.ts: composition root; health wired throughbuildApp(); unknown route → 404 JSON envelope without stack leak.scripts/tests/boundary-checker.test.ts: runcheck-module-boundaries.mjsagainst fixture trees:- fixture
ok(imports inside own module + shared) → exit 0 - fixture
cross-module-internal(imports another module'sdomain/) → exit 1 - fixture
deep-from-app(app importsmodules/x/api/...directly) → exit 1
- fixture
Toolchain checks (manual/CI commands)
npm run buildexits 0npm run typecheckexits 0npm run lintexits 0npm run lint:boundariesexits 0 on clean treenpm testexits 0
Acceptance traceability
| Criterion | Evidence |
|---|---|
| install/build/lint/typecheck/test green | command outputs in implementer.md |
| GET /health 200 ok | health.test.ts + build-app.test.ts |
| src/{modules,shared,infrastructure,app} exist | tree listing in implementer.md |
| boundary violation fails lint | boundary-checker.test.ts fixtures |
| verify.sh green | qa.json evidence |