@@ -50,6 +50,7 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
5050 d : "debug" , "debug-brk" : "debug" ,
5151 i : "inspect" , "inspect-brk" : "inspect" ,
5252 t : "tests" , test : "tests" ,
53+ ru : "runners" , runner : "runners" ,
5354 r : "reporter" ,
5455 c : "colors" , color : "colors" ,
5556 f : "files" , file : "files" ,
@@ -64,6 +65,7 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
6465 browser : process . env . browser || process . env . b || "IE" ,
6566 timeout : process . env . timeout || 40000 ,
6667 tests : process . env . test || process . env . tests || process . env . t ,
68+ runners : process . env . runners || process . env . runner || process . env . ru ,
6769 light : process . env . light === undefined || process . env . light !== "false" ,
6870 reporter : process . env . reporter || process . env . r ,
6971 lint : process . env . lint || true ,
@@ -648,6 +650,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
648650 const debug = cmdLineOptions . debug ;
649651 const inspect = cmdLineOptions . inspect ;
650652 const tests = cmdLineOptions . tests ;
653+ const runners = cmdLineOptions . runners ;
651654 const light = cmdLineOptions . light ;
652655 const stackTraceLimit = cmdLineOptions . stackTraceLimit ;
653656 const testConfigFile = "test.config" ;
@@ -668,8 +671,8 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
668671 workerCount = cmdLineOptions . workers ;
669672 }
670673
671- if ( tests || light || taskConfigsFolder ) {
672- writeTestConfigFile ( tests , light , taskConfigsFolder , workerCount , stackTraceLimit ) ;
674+ if ( tests || runners || light || taskConfigsFolder ) {
675+ writeTestConfigFile ( tests , runners , light , taskConfigsFolder , workerCount , stackTraceLimit ) ;
673676 }
674677
675678 if ( tests && tests . toLocaleLowerCase ( ) === "rwc" ) {
@@ -860,8 +863,8 @@ function cleanTestDirs(done: (e?: any) => void) {
860863}
861864
862865// used to pass data from jake command line directly to run.js
863- function writeTestConfigFile ( tests : string , light : boolean , taskConfigsFolder ?: string , workerCount ?: number , stackTraceLimit ?: string ) {
864- const testConfigContents = JSON . stringify ( { test : tests ? [ tests ] : undefined , light, workerCount, stackTraceLimit, taskConfigsFolder, noColor : ! cmdLineOptions . colors } ) ;
866+ function writeTestConfigFile ( tests : string , runners : string , light : boolean , taskConfigsFolder ?: string , workerCount ?: number , stackTraceLimit ?: string ) {
867+ const testConfigContents = JSON . stringify ( { test : tests ? [ tests ] : undefined , runner : runners ? runners . split ( "," ) : undefined , light, workerCount, stackTraceLimit, taskConfigsFolder, noColor : ! cmdLineOptions . colors } ) ;
865868 console . log ( "Running tests with config: " + testConfigContents ) ;
866869 fs . writeFileSync ( "test.config" , testConfigContents ) ;
867870}
@@ -872,13 +875,14 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
872875 if ( err ) { console . error ( err ) ; done ( err ) ; process . exit ( 1 ) ; }
873876 host = "node" ;
874877 const tests = cmdLineOptions . tests ;
878+ const runners = cmdLineOptions . runners ;
875879 const light = cmdLineOptions . light ;
876880 const testConfigFile = "test.config" ;
877881 if ( fs . existsSync ( testConfigFile ) ) {
878882 fs . unlinkSync ( testConfigFile ) ;
879883 }
880- if ( tests || light ) {
881- writeTestConfigFile ( tests , light ) ;
884+ if ( tests || runners || light ) {
885+ writeTestConfigFile ( tests , runners , light ) ;
882886 }
883887
884888 const args = [ nodeServerOutFile ] ;
0 commit comments