File tree Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ export default async function () {
24
24
25
25
// Major should succeed, but we don't need to test it here since it's tested everywhere else.
26
26
// Major+1 and -1 should fail architect commands, but allow other commands.
27
- await fakeCoreVersion ( cliMajor + 1 ) ;
28
- await expectToFail ( ( ) => ng ( 'build' ) , 'Should fail Major+1' ) ;
29
- await ng ( 'version' ) ;
30
- await fakeCoreVersion ( cliMajor - 1 ) ;
31
- await ng ( 'version' ) ;
32
-
33
- // Restore the original core package.json.
34
- await writeFile ( angularCorePkgPath , originalAngularCorePkgJson ) ;
27
+ try {
28
+ await fakeCoreVersion ( cliMajor + 1 ) ;
29
+ await expectToFail ( ( ) => ng ( 'build' ) , 'Should fail Major+1' ) ;
30
+ await ng ( 'version' ) ;
31
+ await fakeCoreVersion ( cliMajor - 1 ) ;
32
+ await ng ( 'version' ) ;
33
+ } finally {
34
+ // Restore the original core package.json.
35
+ await writeFile ( angularCorePkgPath , originalAngularCorePkgJson ) ;
36
+ }
35
37
}
Original file line number Diff line number Diff line change @@ -242,13 +242,15 @@ async function runInitializer(absoluteName: string) {
242
242
async function runTest ( absoluteName : string ) {
243
243
process . chdir ( join ( getGlobalVariable ( 'projects-root' ) , 'test-project' ) ) ;
244
244
245
- await launchTestProcess ( absoluteName ) ;
246
-
247
- logStack . push ( new logging . NullLogger ( ) ) ;
248
245
try {
249
- await gitClean ( ) ;
246
+ await launchTestProcess ( absoluteName ) ;
250
247
} finally {
251
- logStack . pop ( ) ;
248
+ logStack . push ( new logging . NullLogger ( ) ) ;
249
+ try {
250
+ await gitClean ( ) ;
251
+ } finally {
252
+ logStack . pop ( ) ;
253
+ }
252
254
}
253
255
}
254
256
You can’t perform that action at this time.
0 commit comments