Skip to content

test: add dedicated test suite for latency-budgets - #1235

Merged
thlpkee20-wq merged 1 commit into
RevoraOrg:masterfrom
Promzy204-bad:feature/latency-budgets-test-suite
Sep 29, 2026
Merged

thlpkee20-wq merged 1 commit into
RevoraOrg:masterfrom
Promzy204-bad:feature/latency-budgets-test-suite

Conversation

@Promzy204-bad

Copy link
Copy Markdown
Contributor
  • Add src/lib/latency-budgets.test.ts with 40 focused tests covering LatencyBudgetConfig shape, HOT_ROUTE_BUDGETS catalogue, getLatencyBudget() (exact match, case-insensitive method, path normalisation, boundary inputs), getAllBudgetedRoutes() defensive copy, state mutation safety, and deterministic boundary behaviour

  • Fix getLatencyBudget to return a shallow copy ({ ...found }) instead of a direct reference into the internal catalogue array

  • Fix getAllBudgetedRoutes to return element-level copies (HOT_ROUTE_BUDGETS.map((b) => ({ ...b }))) so callers cannot corrupt the canonical budget registry through mutation

All 40 tests pass. Zero lint and type errors in changed files.
closes #1039

- Add src/lib/latency-budgets.test.ts with 40 focused tests covering
  LatencyBudgetConfig shape, HOT_ROUTE_BUDGETS catalogue, getLatencyBudget()
  (exact match, case-insensitive method, path normalisation, boundary inputs),
  getAllBudgetedRoutes() defensive copy, state mutation safety, and
  deterministic boundary behaviour

- Fix getLatencyBudget to return a shallow copy ({ ...found }) instead of
  a direct reference into the internal catalogue array

- Fix getAllBudgetedRoutes to return element-level copies
  (HOT_ROUTE_BUDGETS.map((b) => ({ ...b }))) so callers cannot corrupt
  the canonical budget registry through mutation

All 40 tests pass. Zero lint and type errors in changed files.
@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@Promzy204-bad Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@thlpkee20-wq
thlpkee20-wq merged commit 9832967 into RevoraOrg:master Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add focused behavior coverage for LatencyBudgetConfig

2 participants