File tree Expand file tree Collapse file tree 1 file changed +4
-19
lines changed
Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -9,32 +9,17 @@ const internalIPv4 = Server.internalIPSync("v4");
99
1010let open ;
1111
12- const needRequireMock =
13- process . version . startsWith ( "v18" ) || process . version . startsWith ( "v19" ) ;
14-
15- if ( needRequireMock ) {
16- open = require ( "open" ) ;
17-
18- jest . mock ( "open" ) ;
19-
20- open . mockImplementation ( ( ) => ( {
21- catch : jest . fn ( ) ,
22- } ) ) ;
23- }
24-
2512describe ( '"open" option' , ( ) => {
2613 let compiler ;
2714
2815 beforeEach ( async ( ) => {
2916 compiler = webpack ( config ) ;
3017
31- if ( ! needRequireMock ) {
32- jest . unstable_mockModule ( "open" , ( ) => ( {
33- default : jest . fn ( ( ) => Promise . resolve ( ) ) ,
34- } ) ) ;
18+ jest . unstable_mockModule ( "open" , ( ) => ( {
19+ default : jest . fn ( ( ) => Promise . resolve ( ) ) ,
20+ } ) ) ;
3521
36- open = ( await import ( "open" ) ) . default ;
37- }
22+ open = ( await import ( "open" ) ) . default ;
3823 } ) ;
3924
4025 afterEach ( async ( ) => {
You can’t perform that action at this time.
0 commit comments