Config module has no tests: env validation and Swagger setup are uncovered
Labels / Complexity: testing · Medium Complexity — Medium
Problem
src/config/ (6 files, 0 *.spec.ts) includes swagger.config.ts (the API docs setup), api-docs.controller.ts, and changelog.ts, and the repo's env validation lives in src/utils/validate-env.ts. None of this is covered by tests: a change that breaks Swagger generation or env validation ships silently, taking the API docs or boot-time checks down without CI noticing.
Why this is architecturally hard
- Env validation is boot-critical.
validate-env.ts decides whether the app starts; tests must cover missing/invalid/valid combinations without actually booting the app.
- Swagger config is generated. Testing it means asserting on the generated document structure, which requires instantiating the module in a test harness.
Acceptance criteria
- Unit tests cover
validate-env.ts for valid, missing, and invalid env combinations.
- Tests assert the Swagger document generates with the expected tags/version.
- Tests run in CI via
npm test.
Out of scope
The hardcoded version issue in api-docs.controller.ts (tracked separately).
Getting started
src/utils/validate-env.ts — the env validation
src/config/swagger.config.ts — the Swagger setup
Commands: npm test, npm run test:cov.
Good first files to read: src/utils/validate-env.ts, src/config/swagger.config.ts.
Config module has no tests: env validation and Swagger setup are uncovered
Labels / Complexity: testing · Medium Complexity — Medium
Problem
src/config/(6 files, 0*.spec.ts) includesswagger.config.ts(the API docs setup),api-docs.controller.ts, andchangelog.ts, and the repo's env validation lives insrc/utils/validate-env.ts. None of this is covered by tests: a change that breaks Swagger generation or env validation ships silently, taking the API docs or boot-time checks down without CI noticing.Why this is architecturally hard
validate-env.tsdecides whether the app starts; tests must cover missing/invalid/valid combinations without actually booting the app.Acceptance criteria
validate-env.tsfor valid, missing, and invalid env combinations.npm test.Out of scope
The hardcoded version issue in
api-docs.controller.ts(tracked separately).Getting started
src/utils/validate-env.ts— the env validationsrc/config/swagger.config.ts— the Swagger setupCommands:
npm test,npm run test:cov.Good first files to read:
src/utils/validate-env.ts,src/config/swagger.config.ts.