From 1dd9b3bc1fa132552e2a139f2d9c472052d716f6 Mon Sep 17 00:00:00 2001 From: Nick Floyd Date: Wed, 13 Nov 2024 15:38:59 -0600 Subject: [PATCH] updates tests to use the new v12 fetch-mock apis --- test/integration/smoke.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/integration/smoke.test.ts b/test/integration/smoke.test.ts index bbbe20eb..280cf1a7 100644 --- a/test/integration/smoke.test.ts +++ b/test/integration/smoke.test.ts @@ -17,9 +17,11 @@ describe("Smoke tests", () => { it("userAgent option", () => { const mock = fetchMock .createInstance() - .getOnce("https://api.github.com/", (_url, { headers }) => { - // @ts-ignore headers has wrong typing in fetch-mock 8.3.2 - expect(headers["user-agent"]).toMatch(/^my-app\/1.2.3 /); + .getOnce("https://api.github.com/", (_url) => { + expect( + mock.callHistory.calls()[0].options.headers!["user-agent"], + ).toMatch(/^my-app\/1.2.3 /); + // expect(headers["user-agent"]).toMatch(/^my-app\/1.2.3 /); return { ok: true }; });