Last active
November 18, 2024 18:27
-
-
Save nedgrady/4e39932965c993b6d5935d4f832235c3 to your computer and use it in GitHub Desktop.
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
test("the returned duplicates contain the first request", () => { | |
const request1 = new http.ClientRequest({ | |
method: "GET", | |
path: "/some-long-running-endpoint", | |
headers: { | |
"x-request-id": "123", | |
authorization: "user1", | |
}, | |
}) | |
const request2 = new http.ClientRequest({ | |
method: "GET", | |
path: "/some-long-running-endpoint", | |
headers: { | |
"x-request-id": "456", | |
authorization: "user1", | |
}, | |
}) | |
const requestsByUser = dedupeRequests([request1, request2]) | |
expect(requestsByUser.get("user1")[0]).toBeRequest(request1) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment