Skip to content

Commit

Permalink
fix up persisted queries test
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Sep 12, 2023
1 parent 4802ad2 commit d65bbf5
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/link/persisted-queries/__tests__/persisted-queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,11 @@ describe("failure path", () => {

const fetcher = (...args: any[]) => {
if (++requestCount % 2) {
return Promise.resolve({
json: () => Promise.resolve(errorResponseWithCode),
text: () => Promise.resolve(errorResponseWithCode),
status,
});
return Promise.resolve(
new Response(errorResponseWithCode, {
status,
})
);
}
return global.fetch.apply(null, args);
};
Expand Down Expand Up @@ -617,11 +617,7 @@ describe("failure path", () => {
const fetcher = (...args: any[]) => {
if (!failed) {
failed = true;
return Promise.resolve({
json: () => Promise.resolve("This will blow up"),
text: () => Promise.resolve("THIS WILL BLOW UP"),
status,
});
return Promise.resolve(new Response("THIS WILL BLOW UP", { status }));
}
return global.fetch.apply(null, args);
};
Expand Down Expand Up @@ -656,11 +652,7 @@ describe("failure path", () => {
const fetcher = (...args: any[]) => {
if (!failed) {
failed = true;
return Promise.resolve({
json: () => Promise.resolve(errorResponse),
text: () => Promise.resolve(errorResponse),
status,
});
return Promise.resolve(new Response(errorResponse, { status }));
}
return global.fetch.apply(null, args);
};
Expand Down

0 comments on commit d65bbf5

Please sign in to comment.