Skip to content

Commit 8f1613d

Browse files
committed
ci: fix update test to work when @angular/cli and @angular/core majors diverge
During releases, there is a brief time where `@angular/core` has released the next version, but `@angular/cli` has not. This test currently fails in such a situation because `@angular/cli` wasn't new enough to trigger the multiple versions upgrade. This fix upgrades `@angular/core` instead, so it will always be consistent.
1 parent eda96de commit 8f1613d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/legacy-cli/e2e/tests/update/update-multiple-versions.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ export default async function () {
1515
extraArgs.push('--next');
1616
}
1717

18-
// Update Angular from v12 to 13
19-
// TODO(dgp1130): Remove hard-coded `--next` after v15 release.
20-
const { stdout } = await ng('update', '--next', ...extraArgs);
18+
// Update Angular from v13 to 14
19+
const { stdout } = await ng('update', ...extraArgs);
2120
if (!/@angular\/core\s+13\.\d\.\d+ -> 14\.\d\.\d+\s+ng update @angular\/core@14/.test(stdout)) {
2221
// @angular/core 13.x.x -> 14.x.x ng update @angular/core@14
2322
throw new Error(
@@ -26,14 +25,14 @@ export default async function () {
2625
);
2726
}
2827

29-
const { message } = await expectToFail(() => ng('update', '@angular/cli', ...extraArgs));
28+
const { message } = await expectToFail(() => ng('update', '@angular/core', ...extraArgs));
3029
if (
3130
!message.includes(
32-
`Updating multiple major versions of '@angular/cli' at once is not supported`,
31+
`Updating multiple major versions of '@angular/core' at once is not supported`,
3332
)
3433
) {
3534
throw new Error(
36-
`Expected error message to include "Updating multiple major versions of '@angular/cli' at once is not supported" but didn't. OUTPUT: \n` +
35+
`Expected error message to include "Updating multiple major versions of '@angular/core' at once is not supported" but didn't. OUTPUT: \n` +
3736
message,
3837
);
3938
}

0 commit comments

Comments
 (0)