@@ -139,11 +139,12 @@ export function silentExecAndWaitForOutputToMatch(cmd: string, args: string[], m
139
139
140
140
let npmInstalledEject = false ;
141
141
export function ng ( ...args : string [ ] ) {
142
+ const argv = getGlobalVariable ( 'argv' ) ;
143
+ const maybeSilentNg = argv [ 'nosilent' ] ? noSilentNg : silentNg ;
142
144
if ( [ 'build' , 'serve' , 'test' , 'e2e' , 'xi18n' ] . indexOf ( args [ 0 ] ) != - 1 ) {
143
145
// If we have the --eject, use webpack for the test.
144
- const argv = getGlobalVariable ( 'argv' ) ;
145
146
if ( args [ 0 ] == 'build' && argv . eject ) {
146
- return silentNg ( 'eject' , ...args . slice ( 1 ) , '--force' )
147
+ return maybeSilentNg ( 'eject' , ...args . slice ( 1 ) , '--force' )
147
148
. then ( ( ) => {
148
149
if ( ! npmInstalledEject ) {
149
150
npmInstalledEject = true ;
@@ -153,14 +154,22 @@ export function ng(...args: string[]) {
153
154
} )
154
155
. then ( ( ) => rimraf ( 'dist' ) )
155
156
. then ( ( ) => _exec ( { silent : true } , 'node_modules/.bin/webpack' , [ ] ) ) ;
157
+ } else if ( args [ 0 ] == 'e2e' ) {
158
+ // Wait 1 second before running any end-to-end test.
159
+ return new Promise ( resolve => setTimeout ( resolve , 1000 ) )
160
+ . then ( ( ) => maybeSilentNg ( ...args ) ) ;
156
161
}
157
162
158
- return silentNg ( ...args ) ;
163
+ return maybeSilentNg ( ...args ) ;
159
164
} else {
160
- return _exec ( { } , 'ng' , args ) ;
165
+ return noSilentNg ( ... args ) ;
161
166
}
162
167
}
163
168
169
+ export function noSilentNg ( ...args : string [ ] ) {
170
+ return _exec ( { } , 'ng' , args ) ;
171
+ }
172
+
164
173
export function silentNg ( ...args : string [ ] ) {
165
174
return _exec ( { silent : true } , 'ng' , args ) ;
166
175
}
0 commit comments