Skip to content

rateLimit lib has no tests: the API rate-limiting helper is uncovered #934

Description

@nanaf6203-bit

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programTrivialtestingTest coverage or test reliability

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions