Commit 8fbc694 1 parent de0dc65 commit 8fbc694 Copy full SHA for 8fbc694
File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,13 @@ export class MockWindow {
210
210
return this . __elementCstr ;
211
211
}
212
212
213
+ fetch ( input : any , init ?: any ) : any {
214
+ if ( typeof fetch === 'function' ) {
215
+ return fetch ( input , init ) ;
216
+ }
217
+ throw new Error ( `fetch() not implemented` ) ;
218
+ }
219
+
213
220
focus ( ) : any {
214
221
/**/
215
222
}
@@ -856,6 +863,13 @@ function resetWindow(win: MockWindow) {
856
863
( win . document as any ) . defaultView = win ;
857
864
} catch ( e ) { }
858
865
}
866
+
867
+ // ensure we don't hold onto nodeFetch values
868
+ ( win as any ) . fetch = null ;
869
+ ( win as any ) . Headers = null ;
870
+ ( win as any ) . Request = null ;
871
+ ( win as any ) . Response = null ;
872
+ ( win as any ) . FetchError = null ;
859
873
}
860
874
}
861
875
You can’t perform that action at this time.
0 commit comments