@@ -139,11 +139,12 @@ export function silentExecAndWaitForOutputToMatch(cmd: string, args: string[], m
139139
140140let npmInstalledEject = false ;
141141export function ng ( ...args : string [ ] ) {
142+ const argv = getGlobalVariable ( 'argv' ) ;
143+ const maybeSilentNg = argv [ 'nosilent' ] ? noSilentNg : silentNg ;
142144 if ( [ 'build' , 'serve' , 'test' , 'e2e' , 'xi18n' ] . indexOf ( args [ 0 ] ) != - 1 ) {
143145 // If we have the --eject, use webpack for the test.
144- const argv = getGlobalVariable ( 'argv' ) ;
145146 if ( args [ 0 ] == 'build' && argv . eject ) {
146- return silentNg ( 'eject' , ...args . slice ( 1 ) , '--force' )
147+ return maybeSilentNg ( 'eject' , ...args . slice ( 1 ) , '--force' )
147148 . then ( ( ) => {
148149 if ( ! npmInstalledEject ) {
149150 npmInstalledEject = true ;
@@ -153,14 +154,22 @@ export function ng(...args: string[]) {
153154 } )
154155 . then ( ( ) => rimraf ( 'dist' ) )
155156 . 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 ) ) ;
156161 }
157162
158- return silentNg ( ...args ) ;
163+ return maybeSilentNg ( ...args ) ;
159164 } else {
160- return _exec ( { } , 'ng' , args ) ;
165+ return noSilentNg ( ... args ) ;
161166 }
162167}
163168
169+ export function noSilentNg ( ...args : string [ ] ) {
170+ return _exec ( { } , 'ng' , args ) ;
171+ }
172+
164173export function silentNg ( ...args : string [ ] ) {
165174 return _exec ( { silent : true } , 'ng' , args ) ;
166175}
0 commit comments