Skip to content

Commit 9c647a7

Browse files
committed
test: update create-angular test to install packages
Previously, this test did not include package installation.
1 parent fa24b97 commit 9c647a7

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tests/legacy-cli/e2e/tests/misc/create-angular.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { join, resolve } from 'path';
1+
import { equal } from 'node:assert';
2+
import { join, resolve } from 'node:path';
23
import { expectFileToExist, readFile, rimraf } from '../../utils/fs';
34
import { getActivePackageManager } from '../../utils/packages';
45
import { silentBun, silentNpm, silentPnpm, silentYarn } from '../../utils/process';
56

67
export default async function () {
78
const currentDirectory = process.cwd();
89
const newDirectory = resolve('../');
9-
1010
const projectName = 'test-project-create';
1111

1212
try {
@@ -15,19 +15,19 @@ export default async function () {
1515

1616
switch (packageManager) {
1717
case 'npm':
18-
await silentNpm('init', '@angular', projectName, '--', '--skip-install', '--style=scss');
18+
await silentNpm('init', '@angular', projectName, '--', '--style=scss');
1919

2020
break;
2121
case 'yarn':
22-
await silentYarn('create', '@angular', projectName, '--skip-install', '--style=scss');
22+
await silentYarn('create', '@angular', projectName, '--style=scss');
2323

2424
break;
2525
case 'bun':
26-
await silentBun('create', '@angular', projectName, '--skip-install', '--style=scss');
26+
await silentBun('create', '@angular', projectName, '--style=scss');
2727

2828
break;
2929
case 'pnpm':
30-
await silentPnpm('create', '@angular', projectName, '--skip-install', '--style=scss');
30+
await silentPnpm('create', '@angular', projectName, '--style=scss');
3131

3232
break;
3333
default:
@@ -36,9 +36,11 @@ export default async function () {
3636

3737
// Check that package manager has been configured based on the package manager used to invoke the create command.
3838
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+
);
4244

4345
// Verify styles was create with correct extension.
4446
await expectFileToExist(join(projectName, 'src/styles.scss'));

0 commit comments

Comments
 (0)