1111'use strict' ;
1212
1313const args = require ( './args' ) ;
14+ const os = require ( 'os' ) ;
1415const path = require ( 'path' ) ;
1516const yargs = require ( 'yargs' ) ;
1617
@@ -54,13 +55,14 @@ function run(cliArgv?: Object, cliInfo?: Array<string>) {
5455
5556 const root = getPackageRoot ( ) ;
5657 const testFilePath = path . resolve ( process . cwd ( ) , argv . _ [ 0 ] ) ;
57- const info = cliInfo ? cliInfo . join ( ', ' ) : '' ;
58-
59- console . log ( `Using Jest Runtime v${ VERSION } , ${ info } ` ) ;
58+ const info = cliInfo ? ', ' + cliInfo . join ( ', ' ) : '' ;
6059
60+ console . log ( `Using Jest Runtime v${ VERSION } ${ info } ` ) ;
6161 readConfig ( argv , root )
6262 . then ( config => {
63- Runtime . buildHasteMap ( config , { maxWorkers : 1 } )
63+ Runtime . buildHasteMap ( config , {
64+ maxWorkers : os . cpus ( ) . length - 1 ,
65+ } )
6466 . then ( hasteMap => {
6567 /* $FlowFixMe */
6668 const TestEnvironment = require ( config . testEnvironment ) ;
@@ -69,8 +71,8 @@ function run(cliArgv?: Object, cliInfo?: Array<string>) {
6971 env . global . console = new Console ( process . stdout , process . stderr ) ;
7072 env . global . jestConfig = config ;
7173
72- const moduleLoader = new Runtime ( config , env , hasteMap . resolver ) ;
73- moduleLoader . requireModule ( testFilePath ) ;
74+ const runtime = new Runtime ( config , env , hasteMap . resolver ) ;
75+ runtime . requireModule ( testFilePath ) ;
7476 } )
7577 . catch ( e => {
7678 console . error ( e ) ;
0 commit comments