()
| 5 | }); |
| 6 | |
| 7 | const 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 | |
| 22 | module.exports = mockFetch; |
no outgoing calls
no test coverage detected
searching dependent graphs…