File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ namespace Harness.Parallel.Host {
28
28
}
29
29
30
30
export function start ( ) {
31
+ initializeProgressBarsDependencies ( ) ;
31
32
console . log ( "Discovering tests..." ) ;
32
33
const discoverStart = + ( new Date ( ) ) ;
33
34
const { statSync } : { statSync ( path : string ) : { size : number } ; } = require ( "fs" ) ;
@@ -254,14 +255,26 @@ namespace Harness.Parallel.Host {
254
255
return ;
255
256
}
256
257
257
- const Mocha = require ( "mocha" ) ;
258
- const Base = Mocha . reporters . Base ;
259
- const color = Base . color ;
260
- const cursor = Base . cursor ;
261
- const readline = require ( "readline" ) ;
262
- const os = require ( "os" ) ;
263
- const tty : { isatty ( x : number ) : boolean } = require ( "tty" ) ;
264
- const isatty = tty . isatty ( 1 ) && tty . isatty ( 2 ) ;
258
+ let Mocha : any ;
259
+ let Base : any ;
260
+ let color : any ;
261
+ let cursor : any ;
262
+ let readline : any ;
263
+ let os : any ;
264
+ let tty : { isatty ( x : number ) : boolean } ;
265
+ let isatty : boolean ;
266
+
267
+ function initializeProgressBarsDependencies ( ) {
268
+ Mocha = require ( "mocha" ) ;
269
+ Base = Mocha . reporters . Base ;
270
+ color = Base . color ;
271
+ cursor = Base . cursor ;
272
+ readline = require ( "readline" ) ;
273
+ os = require ( "os" ) ;
274
+ tty = require ( "tty" ) ;
275
+ isatty = tty . isatty ( 1 ) && tty . isatty ( 2 ) ;
276
+ }
277
+
265
278
class ProgressBars {
266
279
public readonly _options : Readonly < ProgressBarsOptions > ;
267
280
private _enabled : boolean ;
You can’t perform that action at this time.
0 commit comments