Skip to content

Commit

Permalink
updates tests to use the new v12 fetch-mock apis
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfloyd authored and wolfy1339 committed Jan 8, 2025
1 parent a4f9120 commit 1dd9b3b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/integration/smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
});
Expand Down

0 comments on commit 1dd9b3b

Please sign in to comment.