Skip to content

Utils module has no tests: validate-env and shared helpers are uncovered #1138

Description

@nanaf6203-bit

Utils module has no tests: validate-env and shared helpers are uncovered

Labels / Complexity: testing · Trivial — Trivial

Summary

src/utils/ (1 file, validate-env.ts) holds the boot-time env validation that decides whether the app starts — including the JWT_SECRET/JWT_REFRESH_SECRET requirement list. It has no tests. A regression that lets the app boot without required secrets (or blocks boot on valid config) ships silently and only surfaces in deployment.

Proposal

  • Add a spec covering valid config, missing required vars, and invalid values for validate-env.ts.

Acceptance criteria

  • The spec passes and runs in CI via npm test.
  • Coverage for src/utils/ is reported via npm run test:cov.

Getting started

  • src/utils/validate-env.ts — the validation to cover
  • test/unit/ — the mock-based pattern

Commands: npm test, npm run test:cov.

Good first files to read: src/utils/validate-env.ts, test/unit/search-facets.service.spec.ts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions