Versioning module has no tests: version negotiation and compatibility transforms are uncovered
Labels / Complexity: testing · Medium Complexity — Medium
Problem
src/versioning/ (12 files, 0 *.spec.ts) implements the API versioning machinery every versioned endpoint depends on — header negotiation, deprecation warnings, and backward-compatibility.service.ts's per-version response transforms. None of it is pinned by tests: a regression that mis-negotiates a version or drops a compatibility transform ships silently, serving wrong-shaped responses to older clients.
Why this is architecturally hard
- Transform logic is the test design. Compatibility transforms reshape responses per version; tests need fixtures showing the same payload through each version boundary.
- Header negotiation is cross-cutting. Version-header parsing must be exercised through HTTP-level tests to cover missing, invalid, and conflicting version headers.
Acceptance criteria
- Tests cover version-header parsing (valid, missing, invalid), deprecation warnings, and at least one compatibility transform.
- Tests run in CI via
npm test.
- The PR reports the module's coverage change (
npm run test:cov).
Out of scope
Changing versioning behavior; the @ts-nocheck migration for the module (tracked separately).
Getting started
src/versioning/backward-compatibility.service.ts — the transforms
src/versioning/version-header.interceptor.ts — the negotiation
Commands: npm test, npm run test:cov.
Good first files to read: src/versioning/backward-compatibility.service.ts, src/versioning/version-header.interceptor.ts.
Versioning module has no tests: version negotiation and compatibility transforms are uncovered
Labels / Complexity: testing · Medium Complexity — Medium
Problem
src/versioning/(12 files, 0*.spec.ts) implements the API versioning machinery every versioned endpoint depends on — header negotiation, deprecation warnings, andbackward-compatibility.service.ts's per-version response transforms. None of it is pinned by tests: a regression that mis-negotiates a version or drops a compatibility transform ships silently, serving wrong-shaped responses to older clients.Why this is architecturally hard
Acceptance criteria
npm test.npm run test:cov).Out of scope
Changing versioning behavior; the
@ts-nocheckmigration for the module (tracked separately).Getting started
src/versioning/backward-compatibility.service.ts— the transformssrc/versioning/version-header.interceptor.ts— the negotiationCommands:
npm test,npm run test:cov.Good first files to read:
src/versioning/backward-compatibility.service.ts,src/versioning/version-header.interceptor.ts.