Skip to content

Commit

Permalink
fix: fix failing specs
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroslavDionisiev committed Jan 6, 2025
1 parent 384bac6 commit 41816e4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/__mocks__/cross-fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 41816e4

Please sign in to comment.