rateLimit lib has no tests: the API rate-limiting helper is uncovered
Labels / Complexity: testing · Trivial — Trivial
Summary
src/lib/rateLimit.ts (withRateLimit) wraps open API routes (e.g., /api/csp-report) with rate limiting. It has no tests. A regression that disables the limit or mis-applies headers ships silently and un-protects every wrapped route.
Proposal
- Add a spec covering limit hit, limit reset, and pass-through behavior with a controlled store.
Acceptance criteria
- The spec asserts the rate-limit states; it passes via
npm test.
Getting started
src/lib/rateLimit.ts — the helper
src/lib/__tests__/ — existing lib test patterns
Commands: npm test.
Good first files to read: src/lib/rateLimit.ts.
rateLimit lib has no tests: the API rate-limiting helper is uncovered
Labels / Complexity: testing · Trivial — Trivial
Summary
src/lib/rateLimit.ts(withRateLimit) wraps open API routes (e.g.,/api/csp-report) with rate limiting. It has no tests. A regression that disables the limit or mis-applies headers ships silently and un-protects every wrapped route.Proposal
Acceptance criteria
npm test.Getting started
src/lib/rateLimit.ts— the helpersrc/lib/__tests__/— existing lib test patternsCommands:
npm test.Good first files to read:
src/lib/rateLimit.ts.