1
- import { join , resolve } from 'path' ;
1
+ import { equal } from 'node:assert' ;
2
+ import { join , resolve } from 'node:path' ;
2
3
import { expectFileToExist , readFile , rimraf } from '../../utils/fs' ;
3
4
import { getActivePackageManager } from '../../utils/packages' ;
4
5
import { silentBun , silentNpm , silentPnpm , silentYarn } from '../../utils/process' ;
5
6
6
7
export default async function ( ) {
7
8
const currentDirectory = process . cwd ( ) ;
8
9
const newDirectory = resolve ( '../' ) ;
9
-
10
10
const projectName = 'test-project-create' ;
11
11
12
12
try {
@@ -15,19 +15,19 @@ export default async function () {
15
15
16
16
switch ( packageManager ) {
17
17
case 'npm' :
18
- await silentNpm ( 'init' , '@angular' , projectName , '--' , '--skip-install' , '-- style=scss') ;
18
+ await silentNpm ( 'init' , '@angular' , projectName , '--' , '--style=scss' ) ;
19
19
20
20
break ;
21
21
case 'yarn' :
22
- await silentYarn ( 'create' , '@angular' , projectName , '--skip-install' , '-- style=scss') ;
22
+ await silentYarn ( 'create' , '@angular' , projectName , '--style=scss' ) ;
23
23
24
24
break ;
25
25
case 'bun' :
26
- await silentBun ( 'create' , '@angular' , projectName , '--skip-install' , '-- style=scss') ;
26
+ await silentBun ( 'create' , '@angular' , projectName , '--style=scss' ) ;
27
27
28
28
break ;
29
29
case 'pnpm' :
30
- await silentPnpm ( 'create' , '@angular' , projectName , '--skip-install' , '-- style=scss') ;
30
+ await silentPnpm ( 'create' , '@angular' , projectName , '--style=scss' ) ;
31
31
32
32
break ;
33
33
default :
@@ -36,9 +36,11 @@ export default async function () {
36
36
37
37
// Check that package manager has been configured based on the package manager used to invoke the create command.
38
38
const workspace = JSON . parse ( await readFile ( join ( projectName , 'angular.json' ) ) ) ;
39
- if ( workspace . cli ?. packageManager !== packageManager ) {
40
- throw new Error ( `Expected 'packageManager' option to be configured to ${ packageManager } .` ) ;
41
- }
39
+ equal (
40
+ workspace . cli ?. packageManager ,
41
+ packageManager ,
42
+ `Expected 'packageManager' option to be configured to ${ packageManager } .` ,
43
+ ) ;
42
44
43
45
// Verify styles was create with correct extension.
44
46
await expectFileToExist ( join ( projectName , 'src/styles.scss' ) ) ;
0 commit comments