Skip to content

Commit dc9dc0f

Browse files
alan-agius4vikerman
authored andcommitted
test: add --force to version 7 migration when updating prerelease versions
We only use it for a few things but have a strict peerdep. This strictness causes errors when updating the CLI from 7.x to 8.1 next projects: ``` Package "@angular-devkit/build-angular" has an incompatible peer dependency to "@angular/compiler-cli" (requires ">=8.0.0-beta.0 < 9.0.0" (extended), would install "8.1.0-next.3"). ``` `build-angular` didn't have a peerdep on `@angular/compiler-cli` that supported `8.1.0-next` This PR relaxes this requirement. After the other commits get merged and released, we should to revert this commit.
1 parent 6d6f786 commit dc9dc0f

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/legacy-cli/e2e/tests/update/update-7.0.ts

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { createProjectFromAsset } from '../../utils/assets';
22
import { expectFileMatchToExist, expectFileToExist, expectFileToMatch } from '../../utils/fs';
33
import { ng, noSilentNg, silentNpm } from '../../utils/process';
4-
import {
5-
isPrereleaseCli, useBuiltPackages, useCIChrome, useCIDefaults,
6-
} from '../../utils/project';
4+
import { isPrereleaseCli, useBuiltPackages, useCIChrome, useCIDefaults } from '../../utils/project';
75
import { expectToFail } from '../../utils/utils';
86

9-
10-
export default async function () {
11-
const extraUpdateArgs = await isPrereleaseCli() ? ['--next'] : [];
7+
export default async function() {
8+
const extraUpdateArgs = (await isPrereleaseCli()) ? ['--next', '--force'] : [];
129

1310
// Create new project from previous version files.
1411
// We must use the original NPM packages to force a real update.
@@ -23,8 +20,10 @@ export default async function () {
2320

2421
// Test CLI migrations.
2522
// Should update the lazy route syntax via update-lazy-module-paths.
26-
await expectFileToMatch('src/app/app-routing.module.ts',
27-
`loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule)`);
23+
await expectFileToMatch(
24+
'src/app/app-routing.module.ts',
25+
`loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule)`,
26+
);
2827
// Should update tsconfig and src/browserslist via differential-loading.
2928
await expectFileToMatch('tsconfig.json', `"target": "es2015",`);
3029
await expectToFail(() => expectFileToExist('e2e/browserlist'));
@@ -33,8 +32,7 @@ export default async function () {
3332
// Should rename codelyzer rules.
3433
await expectFileToMatch('tslint.json', `use-lifecycle-interface`);
3534
// Unnecessary es6 polyfills should be removed via drop-es6-polyfills.
36-
await expectToFail(() => expectFileToMatch('src/polyfills.ts',
37-
`import 'core-js/es6/symbol';`));
35+
await expectToFail(() => expectFileToMatch('src/polyfills.ts', `import 'core-js/es6/symbol';`));
3836
await expectToFail(() => expectFileToMatch('src/polyfills.ts', `import 'core-js/es6/set';`));
3937

4038
// Use the packages we are building in this commit, and CI Chrome.

0 commit comments

Comments
 (0)