@@ -87,7 +87,7 @@ function possiblyQuote(cmd: string) {
87
87
}
88
88
89
89
let useDebugMode = true ;
90
- let host = cmdLineOptions [ " host" ] ;
90
+ let host = cmdLineOptions . host ;
91
91
92
92
// Constants
93
93
const compilerDirectory = "src/compiler/" ;
@@ -651,15 +651,15 @@ function restoreSavedNodeEnv() {
651
651
}
652
652
653
653
function runConsoleTests ( defaultReporter : string , runInParallel : boolean , done : ( e ?: any ) => void ) {
654
- const lintFlag = cmdLineOptions [ " lint" ] ;
654
+ const lintFlag = cmdLineOptions . lint ;
655
655
cleanTestDirs ( ( err ) => {
656
656
if ( err ) { console . error ( err ) ; failWithStatus ( err , 1 ) ; }
657
- let testTimeout = cmdLineOptions [ " timeout" ] ;
658
- const debug = cmdLineOptions [ " debug" ] ;
659
- const inspect = cmdLineOptions [ " inspect" ] ;
660
- const tests = cmdLineOptions [ " tests" ] ;
661
- const light = cmdLineOptions [ " light" ] ;
662
- const stackTraceLimit = cmdLineOptions [ " stackTraceLimit" ] ;
657
+ let testTimeout = cmdLineOptions . timeout ;
658
+ const debug = cmdLineOptions . debug ;
659
+ const inspect = cmdLineOptions . inspect ;
660
+ const tests = cmdLineOptions . tests ;
661
+ const light = cmdLineOptions . light ;
662
+ const stackTraceLimit = cmdLineOptions . stackTraceLimit ;
663
663
const testConfigFile = "test.config" ;
664
664
if ( fs . existsSync ( testConfigFile ) ) {
665
665
fs . unlinkSync ( testConfigFile ) ;
@@ -675,7 +675,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
675
675
} while ( fs . existsSync ( taskConfigsFolder ) ) ;
676
676
fs . mkdirSync ( taskConfigsFolder ) ;
677
677
678
- workerCount = cmdLineOptions [ " workers" ] ;
678
+ workerCount = cmdLineOptions . workers ;
679
679
}
680
680
681
681
if ( tests || light || taskConfigsFolder ) {
@@ -686,8 +686,8 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
686
686
testTimeout = 400000 ;
687
687
}
688
688
689
- const colors = cmdLineOptions [ " colors" ] ;
690
- const reporter = cmdLineOptions [ " reporter" ] || defaultReporter ;
689
+ const colors = cmdLineOptions . colors ;
690
+ const reporter = cmdLineOptions . reporter || defaultReporter ;
691
691
692
692
// timeout normally isn"t necessary but Travis-CI has been timing out on compiler baselines occasionally
693
693
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
@@ -875,7 +875,7 @@ function cleanTestDirs(done: (e?: any) => void) {
875
875
876
876
// used to pass data from jake command line directly to run.js
877
877
function writeTestConfigFile ( tests : string , light : boolean , taskConfigsFolder ?: string , workerCount ?: number , stackTraceLimit ?: string ) {
878
- const testConfigContents = JSON . stringify ( { test : tests ? [ tests ] : undefined , light, workerCount, stackTraceLimit, taskConfigsFolder, noColor : ! cmdLineOptions [ " colors" ] } ) ;
878
+ const testConfigContents = JSON . stringify ( { test : tests ? [ tests ] : undefined , light, workerCount, stackTraceLimit, taskConfigsFolder, noColor : ! cmdLineOptions . colors } ) ;
879
879
console . log ( "Running tests with config: " + testConfigContents ) ;
880
880
fs . writeFileSync ( "test.config" , testConfigContents ) ;
881
881
}
@@ -885,8 +885,8 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
885
885
cleanTestDirs ( ( err ) => {
886
886
if ( err ) { console . error ( err ) ; done ( err ) ; process . exit ( 1 ) ; }
887
887
host = "node" ;
888
- const tests = cmdLineOptions [ " tests" ] ;
889
- const light = cmdLineOptions [ " light" ] ;
888
+ const tests = cmdLineOptions . tests ;
889
+ const light = cmdLineOptions . light ;
890
890
const testConfigFile = "test.config" ;
891
891
if ( fs . existsSync ( testConfigFile ) ) {
892
892
fs . unlinkSync ( testConfigFile ) ;
@@ -896,8 +896,8 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
896
896
}
897
897
898
898
const args = [ nodeServerOutFile ] ;
899
- if ( cmdLineOptions [ " browser" ] ) {
900
- args . push ( cmdLineOptions [ " browser" ] ) ;
899
+ if ( cmdLineOptions . browser ) {
900
+ args . push ( cmdLineOptions . browser ) ;
901
901
}
902
902
if ( tests ) {
903
903
args . push ( JSON . stringify ( tests ) ) ;
@@ -907,13 +907,13 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
907
907
} ) ;
908
908
909
909
gulp . task ( "generate-code-coverage" , "Generates code coverage data via istanbul" , [ "tests" ] , ( done ) => {
910
- const testTimeout = cmdLineOptions [ " timeout" ] ;
910
+ const testTimeout = cmdLineOptions . timeout ;
911
911
exec ( "istanbul" , [ "cover" , "node_modules/mocha/bin/_mocha" , "--" , "-R" , "min" , "-t" , testTimeout . toString ( ) , run ] , done , done ) ;
912
912
} ) ;
913
913
914
914
915
915
function getDiffTool ( ) {
916
- const program = process . env [ " DIFF" ] ;
916
+ const program = process . env . DIFF ;
917
917
if ( ! program ) {
918
918
console . error ( "Add the 'DIFF' environment variable to the path of the program you want to use." ) ;
919
919
process . exit ( 1 ) ;
@@ -1034,7 +1034,7 @@ gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => {
1034
1034
} ) ;
1035
1035
1036
1036
gulp . task ( "tsc-instrumented" , "Builds an instrumented tsc.js - run with --test=[testname]" , [ "local" , loggedIOJsPath , instrumenterJsPath , servicesFile ] , ( done ) => {
1037
- const test = cmdLineOptions [ " tests" ] || "iocapture" ;
1037
+ const test = cmdLineOptions . tests || "iocapture" ;
1038
1038
exec ( host , [ instrumenterJsPath , "record" , test , builtLocalCompiler ] , done , done ) ;
1039
1039
} ) ;
1040
1040
@@ -1103,7 +1103,7 @@ function spawnLintWorker(files: {path: string}[], callback: (failures: number) =
1103
1103
1104
1104
gulp . task ( "lint" , "Runs tslint on the compiler sources. Optional arguments are: --f[iles]=regex" , [ "build-rules" ] , ( ) => {
1105
1105
if ( fold . isTravis ( ) ) console . log ( fold . start ( "lint" ) ) ;
1106
- const fileMatcher = cmdLineOptions [ " files" ] ;
1106
+ const fileMatcher = cmdLineOptions . files ;
1107
1107
const files = fileMatcher
1108
1108
? `src/**/${ fileMatcher } `
1109
1109
: "Gulpfile.ts 'scripts/generateLocalizedDiagnosticMessages.ts' 'scripts/tslint/**/*.ts' 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'" ;
0 commit comments