@@ -53,7 +53,7 @@ function Command(projectBaseDir, examplesDir, print) {
53
53
print ( '' ) ;
54
54
help ( { print : print } ) ;
55
55
} else {
56
- await runJasmine ( jasmine , env , print ) ;
56
+ await runJasmine ( jasmine , env ) ;
57
57
}
58
58
}
59
59
} ;
@@ -76,8 +76,7 @@ function parseOptions(argv) {
76
76
random ,
77
77
seed ;
78
78
79
- for ( let i in argv ) {
80
- const arg = argv [ i ] ;
79
+ for ( const arg of argv ) {
81
80
if ( arg === '--no-color' ) {
82
81
color = false ;
83
82
} else if ( arg === '--color' ) {
@@ -106,55 +105,56 @@ function parseOptions(argv) {
106
105
unknownOptions . push ( arg ) ;
107
106
}
108
107
}
108
+
109
109
return {
110
- color : color ,
111
- configPath : configPath ,
112
- filter : filter ,
113
- failFast : failFast ,
114
- helpers : helpers ,
115
- requires : requires ,
116
- reporter : reporter ,
117
- files : files ,
118
- random : random ,
119
- seed : seed ,
120
- unknownOptions : unknownOptions
110
+ color,
111
+ configPath,
112
+ filter,
113
+ failFast,
114
+ helpers,
115
+ requires,
116
+ reporter,
117
+ files,
118
+ random,
119
+ seed,
120
+ unknownOptions
121
121
} ;
122
122
}
123
123
124
- async function runJasmine ( jasmine , env , print ) {
125
- await jasmine . loadConfigFile ( env . configPath || process . env . JASMINE_CONFIG_PATH ) ;
124
+ async function runJasmine ( jasmine , options ) {
125
+ await jasmine . loadConfigFile ( options . configPath || process . env . JASMINE_CONFIG_PATH ) ;
126
126
127
- if ( env . failFast !== undefined ) {
127
+ if ( options . failFast !== undefined ) {
128
128
jasmine . env . configure ( {
129
- stopSpecOnExpectationFailure : env . failFast ,
130
- stopOnSpecFailure : env . failFast
129
+ stopSpecOnExpectationFailure : options . failFast ,
130
+ stopOnSpecFailure : options . failFast
131
131
} ) ;
132
132
}
133
133
134
- if ( env . seed !== undefined ) {
135
- jasmine . seed ( env . seed ) ;
134
+ if ( options . seed !== undefined ) {
135
+ jasmine . seed ( options . seed ) ;
136
136
}
137
137
138
- if ( env . random !== undefined ) {
139
- jasmine . randomizeTests ( env . random ) ;
138
+ if ( options . random !== undefined ) {
139
+ jasmine . randomizeTests ( options . random ) ;
140
140
}
141
141
142
- if ( env . helpers !== undefined && env . helpers . length ) {
143
- jasmine . addMatchingHelperFiles ( env . helpers ) ;
142
+ if ( options . helpers !== undefined && options . helpers . length ) {
143
+ jasmine . addMatchingHelperFiles ( options . helpers ) ;
144
144
}
145
145
146
- if ( env . requires !== undefined && env . requires . length ) {
147
- jasmine . addRequires ( env . requires ) ;
146
+ if ( options . requires !== undefined && options . requires . length ) {
147
+ jasmine . addRequires ( options . requires ) ;
148
148
}
149
149
150
- if ( env . reporter !== undefined ) {
151
- await registerReporter ( env . reporter , jasmine ) ;
150
+ if ( options . reporter !== undefined ) {
151
+ await registerReporter ( options . reporter , jasmine ) ;
152
152
}
153
153
154
- jasmine . showColors ( env . color ) ;
154
+ jasmine . showColors ( options . color ) ;
155
155
156
156
try {
157
- await jasmine . execute ( env . files , env . filter ) ;
157
+ await jasmine . execute ( options . files , options . filter ) ;
158
158
} catch ( error ) {
159
159
console . error ( error ) ;
160
160
process . exit ( 1 ) ;
0 commit comments