@@ -22,7 +22,7 @@ type Win = Window &
22
22
} ;
23
23
} ;
24
24
25
- class JSDOMEnvironment implements JestEnvironment {
25
+ class JSDOMEnvironment implements JestEnvironment < number > {
26
26
dom : JSDOM | null ;
27
27
fakeTimers : LegacyFakeTimers < number > | null ;
28
28
fakeTimersModern : ModernFakeTimers | null ;
@@ -52,14 +52,14 @@ class JSDOMEnvironment implements JestEnvironment {
52
52
}
53
53
54
54
// for "universal" code (code should use `globalThis`)
55
- global . global = global ;
55
+ global . global = global as any ;
56
56
57
57
// Node's error-message stack size is limited at 10, but it's pretty useful
58
58
// to see more than that when a test fails.
59
59
this . global . Error . stackTraceLimit = 100 ;
60
60
installCommonGlobals ( global as any , config . globals ) ;
61
61
62
- // TODO: remove this ASAP, but it currntly causes tests to run really slow
62
+ // TODO: remove this ASAP, but it currently causes tests to run really slow
63
63
global . Buffer = Buffer ;
64
64
65
65
// Report uncaught errors.
@@ -101,12 +101,15 @@ class JSDOMEnvironment implements JestEnvironment {
101
101
102
102
this . fakeTimers = new LegacyFakeTimers ( {
103
103
config,
104
- global,
104
+ global : global as unknown as typeof globalThis ,
105
105
moduleMocker : this . moduleMocker ,
106
106
timerConfig,
107
107
} ) ;
108
108
109
- this . fakeTimersModern = new ModernFakeTimers ( { config, global} ) ;
109
+ this . fakeTimersModern = new ModernFakeTimers ( {
110
+ config,
111
+ global : global as unknown as typeof globalThis ,
112
+ } ) ;
110
113
}
111
114
112
115
async setup ( ) : Promise < void > { }
0 commit comments