fix: fix failing specs

This commit is contained in:
MiroslavDionisiev 2025-01-06 17:40:07 +02:00
parent 384bac6738
commit 41816e448c

View file

@ -69,10 +69,13 @@ const mockFetch = (resource, options) => {
}; };
// Mimic the cross-fetch module, but replace its `fetch` with `mockFetch` and add a few extras // Mimic the cross-fetch module, but replace its `fetch` with `mockFetch` and add a few extras
module.exports = {
...crossFetch, // Headers, Request, Response, etc. module.exports = exports = mockFetch;
default: mockFetch, exports.fetch = mockFetch;
fetch: mockFetch, exports.Headers = crossFetch.Headers;
mockFetch, exports.Request = crossFetch.Request;
successText exports.Response = crossFetch.Response;
}; exports.successText = successText;
// Needed for TypeScript consumers without esModuleInterop.
exports.default = mockFetch;