Skip to content

test: cover error handler limits#40

Open
xx7412421-cloud wants to merge 3 commits into
StableRoute-Org:mainfrom
xx7412421-cloud:main
Open

test: cover error handler limits#40
xx7412421-cloud wants to merge 3 commits into
StableRoute-Org:mainfrom
xx7412421-cloud:main

Conversation

@xx7412421-cloud

Copy link
Copy Markdown

Closes #17

Summary

  • add dedicated error handler coverage for JSON bodies over the 100 KiB limit
  • assert an exact-limit request reaches route validation instead of the parser limit branch
  • assert generic parser failures return the canonical 500 shape with method, path, and requestId
  • let the existing rate-limit tests explicitly opt into the limiter so the full suite can validate cleanly under Jest

Validation

  • npm test -- errorHandler.test.ts --runInBand
  • npm test -- rateLimit.test.ts --runInBand
  • npm test -- --runInBand
  • npm run lint
  • npm run build

Keeps the default test bypass while allowing the rate-limit suite to exercise the middleware.
Sets the test-only rate-limit opt-in for the existing rate limiter suite.
Adds dedicated payload limit and generic error handler coverage for StableRoute-Org#17.
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 test coverage for the 100KiB body limit and 413 error mapping

1 participant