1
1
import { moveFile } from '../../utils/fs' ;
2
- import { installPackage , uninstallPackage } from '../../utils/packages' ;
2
+ import { getActivePackageManager , installPackage , uninstallPackage } from '../../utils/packages' ;
3
3
import { execAndWaitForOutputToMatch , ng } from '../../utils/process' ;
4
4
import { expectToFail } from '../../utils/utils' ;
5
5
@@ -14,7 +14,13 @@ export default async function () {
14
14
/ C o u l d n o t f i n d t h e ' @ a n g u l a r - d e v k i t \/ b u i l d - a n g u l a r : b r o w s e r ' b u i l d e r ' s n o d e p a c k a g e \. / ,
15
15
) ;
16
16
await expectToFail ( ( ) =>
17
- execAndWaitForOutputToMatch ( 'ng' , [ 'build' ] , / N o d e p a c k a g e s m a y n o t b e i n s t a l l e d \. / ) ,
17
+ execAndWaitForOutputToMatch (
18
+ 'ng' ,
19
+ [ 'build' ] ,
20
+ new RegExp (
21
+ `Node packages may not be installed\. Try installing with '${ getActivePackageManager ( ) } install'\.` ,
22
+ ) ,
23
+ ) ,
18
24
) ;
19
25
20
26
await moveFile ( 'node_modules' , 'temp_node_modules' ) ;
@@ -25,7 +31,13 @@ export default async function () {
25
31
[ 'build' ] ,
26
32
/ C o u l d n o t f i n d t h e ' @ a n g u l a r - d e v k i t \/ b u i l d - a n g u l a r : b r o w s e r ' b u i l d e r ' s n o d e p a c k a g e \. / ,
27
33
) ;
28
- await execAndWaitForOutputToMatch ( 'ng' , [ 'build' ] , / N o d e p a c k a g e s m a y n o t b e i n s t a l l e d \. / ) ;
34
+ await execAndWaitForOutputToMatch (
35
+ 'ng' ,
36
+ [ 'build' ] ,
37
+ new RegExp (
38
+ `Node packages may not be installed\. Try installing with '${ getActivePackageManager ( ) } install'\.` ,
39
+ ) ,
40
+ ) ;
29
41
} finally {
30
42
await moveFile ( 'temp_node_modules' , 'node_modules' ) ;
31
43
await installPackage ( '@angular-devkit/build-angular' ) ;
0 commit comments