@@ -31,19 +31,26 @@ class JSDOMEnvironment implements JestEnvironment<number> {
3131 moduleMocker : ModuleMocker | null ;
3232
3333 constructor ( config : Config . ProjectConfig , options ?: EnvironmentContext ) {
34- this . dom = new JSDOM ( typeof config . testEnvironmentOptions . html === 'string' ? config . testEnvironmentOptions . html : '<!DOCTYPE html>' , {
35- pretendToBeVisual : true ,
36- resources :
37- typeof config . testEnvironmentOptions . userAgent === 'string'
38- ? new ResourceLoader ( {
39- userAgent : config . testEnvironmentOptions . userAgent ,
40- } )
41- : undefined ,
42- runScripts : 'dangerously' ,
43- url : config . testURL ,
44- virtualConsole : new VirtualConsole ( ) . sendTo ( options ?. console || console ) ,
45- ...config . testEnvironmentOptions ,
46- } ) ;
34+ this . dom = new JSDOM (
35+ typeof config . testEnvironmentOptions . html === 'string'
36+ ? config . testEnvironmentOptions . html
37+ : '<!DOCTYPE html>' ,
38+ {
39+ pretendToBeVisual : true ,
40+ resources :
41+ typeof config . testEnvironmentOptions . userAgent === 'string'
42+ ? new ResourceLoader ( {
43+ userAgent : config . testEnvironmentOptions . userAgent ,
44+ } )
45+ : undefined ,
46+ runScripts : 'dangerously' ,
47+ url : config . testURL ,
48+ virtualConsole : new VirtualConsole ( ) . sendTo (
49+ options ?. console || console ,
50+ ) ,
51+ ...config . testEnvironmentOptions ,
52+ } ,
53+ ) ;
4754 const global = ( this . global = this . dom . window . document
4855 . defaultView as unknown as Win ) ;
4956
0 commit comments