Skip to content

Commit 572821e

Browse files
committed
Define fetch on jsdom window
Fixes codesandbox#1861
1 parent 10c21d6 commit 572821e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/app/src/sandbox/eval/tests/jest-lite.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ export default class TestRunner {
122122
const { window: jsdomWindow } = this.dom;
123123
const { document: jsdomDocument } = jsdomWindow;
124124

125-
// Date is not set correctly on window in JSDOM. This breaks Jest
125+
// Set the modules that are not set on JSDOM
126126
jsdomWindow.Date = Date;
127+
jsdomWindow.fetch = fetch;
127128

128129
return {
129130
...jestTestHooks,

0 commit comments

Comments
 (0)