-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular/cli): error when updating Angular packages across multi-…
…major migrations With this change we show an error message when users try to update `@angular/` and `@nguniversal/` packages across multiple major versions. (cherry picked from commit d60d374)
- Loading branch information
1 parent
03da128
commit 745d777
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/legacy-cli/e2e/tests/update/update-multiple-versions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { createProjectFromAsset } from '../../utils/assets'; | ||
import { ng } from '../../utils/process'; | ||
import { expectToFail } from '../../utils/utils'; | ||
|
||
export default async function () { | ||
await createProjectFromAsset('7.0-project'); | ||
|
||
const extraArgs = ['--force']; | ||
const { message } = await expectToFail(() => | ||
ng('update', '@angular/core', ...extraArgs), | ||
); | ||
if ( | ||
!message.includes(`Updating multiple major versions of '@angular/core' at once is not supported`) | ||
) { | ||
console.error(message); | ||
throw new Error( | ||
`Expected error message to include "Updating multiple major versions of '@angular/core' at once is not supported" but didn't.`, | ||
); | ||
} | ||
} |