-
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
ce1ec04
commit 30295b3
Showing
2 changed files
with
63 additions
and
23 deletions.
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
35 changes: 35 additions & 0 deletions
35
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,35 @@ | ||
import { createProjectFromAsset } from '../../utils/assets'; | ||
import { installWorkspacePackages, setRegistry } from '../../utils/packages'; | ||
import { ng } from '../../utils/process'; | ||
import { isPrereleaseCli } from '../../utils/project'; | ||
import { expectToFail } from '../../utils/utils'; | ||
|
||
export default async function () { | ||
try { | ||
await createProjectFromAsset('8.0-project', true, true); | ||
await setRegistry(false); | ||
await installWorkspacePackages(); | ||
|
||
await setRegistry(true); | ||
const extraArgs = ['--force']; | ||
if (isPrereleaseCli()) { | ||
extraArgs.push('--next'); | ||
} | ||
|
||
const { message } = await expectToFail(() => | ||
ng('update', '@angular/cli', '--force', ...extraArgs), | ||
); | ||
if ( | ||
!message.includes( | ||
`Updating multiple major versions of '@angular/cli' at once is not supported`, | ||
) | ||
) { | ||
console.error(message); | ||
throw new Error( | ||
`Expected error message to include "Updating multiple major versions of '@angular/cli' at once is not supported" but didn't.`, | ||
); | ||
} | ||
} finally { | ||
await setRegistry(true); | ||
} | ||
} |