@@ -5,38 +5,28 @@ import { expectToFail } from '../../../utils/utils';
5
5
6
6
export default async function ( ) {
7
7
// The environment variable has priority over the .npmrc
8
- let originalRegistryVariable ;
9
- if ( process . env [ 'NPM_CONFIG_REGISTRY' ] ) {
10
- originalRegistryVariable = process . env [ 'NPM_CONFIG_REGISTRY' ] ;
11
- delete process . env [ 'NPM_CONFIG_REGISTRY' ] ;
12
- }
8
+ delete process . env [ 'NPM_CONFIG_REGISTRY' ] ;
13
9
14
- try {
15
- const command = [ 'add' , '@angular/pwa' , '--skip-confirmation' ] ;
16
- await expectFileNotToExist ( 'src/manifest.webmanifest' ) ;
10
+ const command = [ 'add' , '@angular/pwa' , '--skip-confirmation' ] ;
11
+ await expectFileNotToExist ( 'src/manifest.webmanifest' ) ;
17
12
18
- // Works with unscoped registry authentication details
19
- await createNpmConfigForAuthentication ( false ) ;
20
- await ng ( ...command ) ;
21
- await expectFileToExist ( 'src/manifest.webmanifest' ) ;
22
- await git ( 'clean' , '-dxf' ) ;
13
+ // Works with unscoped registry authentication details
14
+ await createNpmConfigForAuthentication ( false ) ;
15
+ await ng ( ...command ) ;
16
+ await expectFileToExist ( 'src/manifest.webmanifest' ) ;
17
+ await git ( 'clean' , '-dxf' ) ;
23
18
24
- // Works with scoped registry authentication details
25
- await expectFileNotToExist ( 'src/manifest.webmanifest' ) ;
19
+ // Works with scoped registry authentication details
20
+ await expectFileNotToExist ( 'src/manifest.webmanifest' ) ;
26
21
27
- await createNpmConfigForAuthentication ( true ) ;
28
- await ng ( ...command ) ;
29
- await expectFileToExist ( 'src/manifest.webmanifest' ) ;
22
+ await createNpmConfigForAuthentication ( true ) ;
23
+ await ng ( ...command ) ;
24
+ await expectFileToExist ( 'src/manifest.webmanifest' ) ;
30
25
31
- // Invalid authentication token
32
- await createNpmConfigForAuthentication ( false , true ) ;
33
- await expectToFail ( ( ) => ng ( ...command ) ) ;
26
+ // Invalid authentication token
27
+ await createNpmConfigForAuthentication ( false , true ) ;
28
+ await expectToFail ( ( ) => ng ( ...command ) ) ;
34
29
35
- await createNpmConfigForAuthentication ( true , true ) ;
36
- await expectToFail ( ( ) => ng ( ...command ) ) ;
37
- } finally {
38
- if ( originalRegistryVariable ) {
39
- process . env [ 'NPM_CONFIG_REGISTRY' ] = originalRegistryVariable ;
40
- }
41
- }
30
+ await createNpmConfigForAuthentication ( true , true ) ;
31
+ await expectToFail ( ( ) => ng ( ...command ) ) ;
42
32
}
0 commit comments