@@ -3,23 +3,26 @@ import { expectFileToExist, readFile, rimraf } from '../../../utils/fs';
3
3
import { ng , npm } from '../../../utils/process' ;
4
4
5
5
export default async function ( ) {
6
- // forcibly remove in case another test doesn't clean itself up
7
- await rimraf ( 'node_modules/@angular/pwa' ) ;
6
+ // forcibly remove in case another test doesn't clean itself up
7
+ await rimraf ( 'node_modules/@angular/pwa' ) ;
8
8
9
- // set yarn as package manager
10
- await ng ( 'config' , 'cli.packageManager' , 'yarn' ) ;
11
- await ng ( 'add' , '@angular/pwa' ) ;
12
- await expectFileToExist ( join ( process . cwd ( ) , 'src/manifest.webmanifest' ) ) ;
9
+ // set yarn as package manager
10
+ await ng ( 'config' , 'cli.packageManager' , 'yarn' ) ;
11
+ await ng ( 'add' , '@angular/pwa' , '--registry=http://localhost:4873 ') ;
12
+ await expectFileToExist ( join ( process . cwd ( ) , 'src/manifest.webmanifest' ) ) ;
13
13
14
- // Angular PWA doesn't install as a dependency
15
- const { dependencies, devDependencies } = JSON . parse ( await readFile ( join ( process . cwd ( ) , 'package.json' ) ) ) ;
16
- const hasPWADep = Object . keys ( { ...dependencies , ...devDependencies } )
17
- . some ( d => d === '@angular/pwa' ) ;
18
- if ( hasPWADep ) {
19
- throw new Error ( `Expected 'package.json' not to contain a dependency on '@angular/pwa'.` ) ;
20
- }
14
+ // Angular PWA doesn't install as a dependency
15
+ const { dependencies, devDependencies } = JSON . parse (
16
+ await readFile ( join ( process . cwd ( ) , 'package.json' ) ) ,
17
+ ) ;
18
+ const hasPWADep = Object . keys ( { ...dependencies , ...devDependencies } ) . some (
19
+ ( d ) => d === '@angular/pwa' ,
20
+ ) ;
21
+ if ( hasPWADep ) {
22
+ throw new Error ( `Expected 'package.json' not to contain a dependency on '@angular/pwa'.` ) ;
23
+ }
21
24
22
- // 'yarn' will nuke the entire node_modules when it is triggered during the above tests.
23
- await rimraf ( 'node_modules' ) ;
24
- await npm ( 'install' ) ;
25
+ // 'yarn' will nuke the entire node_modules when it is triggered during the above tests.
26
+ await rimraf ( 'node_modules' ) ;
27
+ await npm ( 'install' ) ;
25
28
}
0 commit comments