diff --git a/src/hydra/parseHydraDocumentation.test.ts b/src/hydra/parseHydraDocumentation.test.ts index 399af6a..4c2f4fe 100644 --- a/src/hydra/parseHydraDocumentation.test.ts +++ b/src/hydra/parseHydraDocumentation.test.ts @@ -1591,9 +1591,16 @@ test("Resource parameters can be retrieved", async () => { const parameters = await resource.getParameters(); expect(fetchSpy).toHaveBeenCalledTimes(3); - expect(fetchSpy).toHaveBeenLastCalledWith("http://localhost/books", { - headers: {}, - }); + const lastCall = fetchSpy.mock.lastCall; + assert(lastCall !== undefined); + + const [lastUrl, lastOptions] = lastCall; + assert(lastOptions !== undefined); + + expect(lastUrl).toBe("http://localhost/books"); + expect(new Headers(lastOptions.headers).get("Accept")).toBe( + "application/ld+json", + ); expect(parameters).toEqual([ { description: "",