Skip to content

Commit 44b0472

Browse files
committed
fix(tests): update fetchWithAuth function calls to use options object
- Update unit tests to use new fetchWithAuth signature - Function now takes options object instead of separate parameters - Fixes tests broken after rebase with Main
1 parent d6e09b7 commit 44b0472

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/unit/fetch-utilities.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe("Unit Tests - Fetch Utilities", () => {
5454
it("should add Authorization header when not present", async () => {
5555
const mockFetch = jest.fn().mockResolvedValue({ ok: true });
5656
const apiKey = "test-api-key";
57-
const authenticatedFetch = fetchWithAuth(apiKey, mockFetch);
57+
const authenticatedFetch = fetchWithAuth({ apiKey, customFetch: mockFetch });
5858

5959
await authenticatedFetch("https://api.example.com/test", {});
6060

@@ -73,7 +73,7 @@ describe("Unit Tests - Fetch Utilities", () => {
7373
it("should not override existing Authorization header", async () => {
7474
const mockFetch = jest.fn().mockResolvedValue({ ok: true });
7575
const apiKey = "test-api-key";
76-
const authenticatedFetch = fetchWithAuth(apiKey, mockFetch);
76+
const authenticatedFetch = fetchWithAuth({ apiKey, customFetch: mockFetch });
7777

7878
const existingHeaders = new Headers();
7979
existingHeaders.set("Authorization", "Bearer existing-token");
@@ -90,7 +90,7 @@ describe("Unit Tests - Fetch Utilities", () => {
9090
it("should preserve other headers", async () => {
9191
const mockFetch = jest.fn().mockResolvedValue({ ok: true });
9292
const apiKey = "test-api-key";
93-
const authenticatedFetch = fetchWithAuth(apiKey, mockFetch);
93+
const authenticatedFetch = fetchWithAuth({ apiKey, customFetch: mockFetch });
9494

9595
const headers = { "Content-Type": "application/json", "X-Custom": "value" };
9696

0 commit comments

Comments
 (0)