File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
packages/angular/cli/models
tests/legacy-cli/e2e/tests/commands Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -166,12 +166,12 @@ export abstract class ArchitectCommand extends Command<ArchitectCommandOptions>
166
166
if ( ! targetSpec . project && this . target ) {
167
167
// This runs each target sequentially.
168
168
// Running them in parallel would jumble the log messages.
169
- return from ( this . getProjectNamesByTarget ( this . target ) ) . pipe (
169
+ return await from ( this . getProjectNamesByTarget ( this . target ) ) . pipe (
170
170
concatMap ( project => runSingleTarget ( { ...targetSpec , project } ) ) ,
171
171
toArray ( ) ,
172
172
) . toPromise ( ) . then ( results => results . every ( res => res === 0 ) ? 0 : 1 ) ;
173
173
} else {
174
- return runSingleTarget ( targetSpec ) . toPromise ( ) ;
174
+ return await runSingleTarget ( targetSpec ) . toPromise ( ) ;
175
175
}
176
176
} catch ( e ) {
177
177
if ( e instanceof schema . SchemaValidationException ) {
@@ -182,8 +182,6 @@ export abstract class ArchitectCommand extends Command<ArchitectCommandOptions>
182
182
if ( unknownProperty in options ) {
183
183
const dashes = unknownProperty . length === 1 ? '-' : '--' ;
184
184
this . logger . fatal ( `Unknown option: '${ dashes } ${ unknownProperty } '` ) ;
185
-
186
- break ;
187
185
}
188
186
}
189
187
newErrors . push ( schemaError ) ;
Original file line number Diff line number Diff line change 1
- import { ng } from '../../utils/process' ;
1
+ import { execAndWaitForOutputToMatch , ng } from '../../utils/process' ;
2
+ import { expectToFail } from '../../utils/utils' ;
2
3
3
4
export default async function ( ) {
4
- const { stderr } = await ng ( 'build' , '--notanoption' ) ;
5
+ // await expectToFail(() => ng('build', '--notanoption') );
5
6
6
- if ( ! stderr . match ( / U n k n o w n o p t i o n : ' - - n o t a n o p t i o n ' / ) ) {
7
- throw new Error ( `Expected "Unknown option:", received "${ JSON . stringify ( stderr ) } ".` ) ;
8
- }
7
+ await execAndWaitForOutputToMatch (
8
+ 'ng' ,
9
+ [ 'build' , '--notanoption' ] ,
10
+ / U n k n o w n o p t i o n : ' - - n o t a n o p t i o n ' / ,
11
+ ) ;
9
12
}
You can’t perform that action at this time.
0 commit comments