Skip to content

Commit

Permalink
Add tests for passing headers. Bump to 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cuibonobo committed Dec 22, 2023
1 parent e3fb7bf commit 2b23d9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ test("Can set custom `fetch` functions", async () => {
expect(result.data).toBe(testMsg);
});

test("Headers are passed to Axios", async () => {
const result = await fetchAdapter({ url, headers: { "Content-Type": "application/json" } });
expect(result.request.headers.get("Content-Type")).toBe("application/json");
});

test("Invalid request will throw an error", async () => {
// Disables fetch mock for the rest of this file
jest.restoreAllMocks();
Expand Down

0 comments on commit 2b23d9f

Please sign in to comment.