test(etag): add test coverage for pairs-list ETag and 304 conditional… - #438
Merged
mikewheeleer merged 1 commit intoJul 26, 2026
Merged
Conversation
Contributor
|
solid — thanks for picking it up 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Added comprehensive test coverage for the
GET /api/v1/pairsweakETagand304 Not Modifiedconditional response behavior insrc/__tests__/etag.test.ts:GETresponse:GET /api/v1/pairsreturns status200with a weakETagheader (W/"...").200body is valid JSON containing thepairsarray.GETwith matchingIf-None-Match:ETagfrom the initial response header and reused it in a follow-up request withIf-None-Match.304 Not Modifiedwith an empty body (text === ""and no JSON payload).GETwithoutIf-None-Matchheader:If-None-Matchreturn200with full body andETagheader.ETagand causes a request with a staleIf-None-Matchto return200with the new pair included.ETagand causes a request with a staleIf-None-Matchto return200with the pair omitted.HEAD /api/v1/pairscoverage:If-None-MatchonHEADreturns304with empty body.If-None-MatchonHEADreturns200with empty body,Content-Length,Content-Type, andETagheaders matchingGET.Build and Test Verification
1. TypeScript Build (
npm run build)Build finished with 0 errors.
2. ESLint (
npm run lint)Lint finished with 0 errors.
3. Test Suite (
npm test)4. Coverage Summary (
npm run test:coverage)Closes #282