Skip to content

Commit

Permalink
test: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
orionmiz committed Aug 9, 2023
1 parent e7609fd commit a68859e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/plantae/src/axios/createAxiosInterceptors.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ describe("axios:afterResponse -", () => {
const myPlugin = (): Plugin => ({
name: "myPlugin",
hooks: {
afterResponse: async (res) => {
res.body = "baz";
return res;
afterResponse: async () => {
return new Response("baz");
},
},
});
Expand All @@ -100,9 +99,11 @@ describe("axios:afterResponse -", () => {
name: "myPlugin",
hooks: {
afterResponse: async (res) => {
res.body = "first";
res.headers.set("x-first", "foo");
return res;

return new Response("first", {
headers: res.headers,
});
},
},
});
Expand All @@ -117,9 +118,11 @@ describe("axios:afterResponse -", () => {
name: "overridenPlugin",
hooks: {
afterResponse: async (res) => {
res.body = "second";
res.headers.set("x-second", "bar");
return res;

return new Response("second", {
headers: res.headers,
});
},
},
});
Expand Down

0 comments on commit a68859e

Please sign in to comment.