-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.test.js
More file actions
29 lines (28 loc) · 1016 Bytes
/
index.test.js
File metadata and controls
29 lines (28 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
test("this is test - the retry attempt hashes URI queries", async () => {
mockPool
.intercept({ method: "GET", path: "/test?foo=bar" })
.reply(504, { body: "foo", status: 504 })
.times(6);
const httpClient = getHttpClient();
await expect(
httpClient.get("/test?foo=bar", { useRetryPattern: false })
).rejects.toMatchObject({
_data: { status: 504 },
});
assertRetryLogs({ method: "get", path: "/test?foo=bar" });
assertRequestLogs({ statusCode: 504 });
});
test.only("fragment this is test - the retry attempt hashes URI queries", async () => {
mockPool
.intercept({ method: "GET", path: "/test?foo=bar#page=1" })
.reply(504, { body: "foo", status: 504 })
.times(6);
const httpClient = getHttpClient();
await expect(
httpClient.get("/test?foo=bar#page=1", { useRetryPattern: false })
).rejects.toMatchObject({
_data: { status: 504 },
});
assertRetryLogs({ method: "get", path: "/test?foo=bar#page=1" });
assertRequestLogs({ statusCode: 504 });
});