Open sibelius opened 1 year ago
I'd like to build something like this
export const assertFetch = (url, options, fn: MockResponseInitFunction) => { fetchMock.mockResponseOnce(async (req) => { expect(req.url).toBe(url); expect(req.options).toEqual(options); return normalizeResponse(fn); }); };
Where I assert the value of url and option of the request, but also mock the response
for this, I need to reuse normalizeResponse to keep the same api
normalizeResponse
I'd like to build something like this
Where I assert the value of url and option of the request, but also mock the response
for this, I need to reuse
normalizeResponse
to keep the same api