an error”, () => { it("should trigger the API call”, (done) => { const error = “Oh no, the house is on fire!”; const promise = Promise.rejects(error); const fetchMock = jest.fn().mockReturnValue(promise); const fakeAPIClient = { fetch: fetchMock }; callAsync(fakeAPIClient); fakeAPIClient().catch((response) => { expect(response).toBe(error); done(); }); }); }); });