From 41816e448c082a78d1572c0c788eb5f64ff6bd3a Mon Sep 17 00:00:00 2001 From: MiroslavDionisiev <miroslav@scratch.org> Date: Mon, 6 Jan 2025 17:40:07 +0200 Subject: [PATCH] fix: fix failing specs --- test/__mocks__/cross-fetch.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/__mocks__/cross-fetch.js b/test/__mocks__/cross-fetch.js index 9689f29..7c5d0cd 100644 --- a/test/__mocks__/cross-fetch.js +++ b/test/__mocks__/cross-fetch.js @@ -69,10 +69,13 @@ const mockFetch = (resource, options) => { }; // Mimic the cross-fetch module, but replace its `fetch` with `mockFetch` and add a few extras -module.exports = { - ...crossFetch, // Headers, Request, Response, etc. - default: mockFetch, - fetch: mockFetch, - mockFetch, - successText -}; + +module.exports = exports = mockFetch; +exports.fetch = mockFetch; +exports.Headers = crossFetch.Headers; +exports.Request = crossFetch.Request; +exports.Response = crossFetch.Response; +exports.successText = successText; + +// Needed for TypeScript consumers without esModuleInterop. +exports.default = mockFetch;