Skip to content

Commit 2d729e7

Browse files
authored
fix(globals): Stop overwriting global.fetch (#295)
1 parent 9b72ddf commit 2d729e7

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/globals.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
import crypto from 'node:crypto'
22

3-
const webFetch = global.fetch
4-
53
/** jest dose not use crypto in the global, but this is OK for node 18 */
64
if (typeof global.crypto === 'undefined') {
75
global.crypto = crypto as Crypto
86
}
9-
10-
global.fetch = (info, init?) => {
11-
init = {
12-
// Disable compression handling so people can return the result of a fetch
13-
// directly in the loader without messing with the Content-Encoding header.
14-
compress: false,
15-
...init,
16-
} as RequestInit
17-
18-
return webFetch(info as RequestInfo, init)
19-
}

0 commit comments

Comments
 (0)