@@ -41,6 +41,7 @@ const defaultConfig: Config = {
4141 timeout : defaultTimeout ,
4242 updateSnapshots : 'missing' ,
4343 workers : Math . ceil ( require ( 'os' ) . cpus ( ) . length / 2 ) ,
44+ reuseWorkers : true ,
4445} ;
4546
4647export function addTestCommand ( program : Command ) {
@@ -56,6 +57,7 @@ export function addTestCommand(program: Command) {
5657 command . option ( '--global-timeout <timeout>' , `Maximum time this test suite can run in milliseconds (default: unlimited)` ) ;
5758 command . option ( '-j, --workers <workers>' , `Number of concurrent workers, use 1 to run in a single worker (default: number of CPU cores / 2)` ) ;
5859 command . option ( '--list' , `Collect all the tests and report them, but do not run` ) ;
60+ command . option ( '--no-reuse-workers' , `Respawn workers for each spec (default: reuse enabled)` ) ;
5961 command . option ( '--max-failures <N>' , `Stop after the first N failures` ) ;
6062 command . option ( '--output <dir>' , `Folder for output artifacts (default: "test-results")` ) ;
6163 command . option ( '--quiet' , `Suppress stdio` ) ;
@@ -222,6 +224,7 @@ function overridesFromOptions(options: { [key: string]: any }): Config {
222224 timeout : isDebuggerAttached ? 0 : ( options . timeout ? parseInt ( options . timeout , 10 ) : undefined ) ,
223225 updateSnapshots : options . updateSnapshots ? 'all' as const : undefined ,
224226 workers : options . workers ? parseInt ( options . workers , 10 ) : undefined ,
227+ reuseWorkers : options . reuseWorkers === false ? false : undefined ,
225228 } ;
226229}
227230
0 commit comments