MCPcopy Create free account
hub / github.com/pmmmwh/react-refresh-webpack-plugin / mockFetch

Function mockFetch

test/mocks/fetch.js:7–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5});
6
7const mockFetch = () => {
8 const originalFetch = global.fetch;
9
10 const fetchMock = new Function();
11 global.fetch = fetchMock;
12
13 function mockRestore() {
14 global.fetch = originalFetch;
15 }
16
17 cleanupHandlers.add(mockRestore);
18
19 return [fetchMock, mockRestore];
20};
21
22module.exports = mockFetch;

Callers 1

loader.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…