Skip to content

Commit

Permalink
test(@angular/cli): fix failing CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-agius4 committed Nov 24, 2021
1 parent 886d251 commit 21a49e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/angular/cli/commands/update-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const pickManifest = require('npm-pick-manifest') as (

const oldConfigFileNames = ['.angular-cli.json', 'angular-cli.json'];


/**
* Disable CLI version mismatch checks and forces usage of the invoked CLI
* instead of invoking the local installed version.
Expand Down Expand Up @@ -494,8 +493,9 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
}
}

let result: boolean;
if (typeof options.migrateOnly == 'string') {
await this.executeMigration(
result = await this.executeMigration(
packageName,
migrations,
options.migrateOnly,
Expand All @@ -512,15 +512,15 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
const migrationRange = new semver.Range(
'>' + from + ' <=' + (options.to || packageNode.version),
);
await this.executeMigrations(
result = await this.executeMigrations(
packageName,
migrations,
migrationRange,
options.createCommits,
);
}

return 1;
return result ? 0 : 1;
}

const requests: {
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/build/material.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default async function () {

await installWorkspacePackages();
} else {
await installPackage('@angular/material-moment-adapter');
await installPackage('@angular/material-moment-adapter@11');
}

await installPackage('moment');
Expand Down
5 changes: 0 additions & 5 deletions tests/legacy-cli/e2e/tests/commands/add/version-specifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ export default async function () {
throw new Error('Installation was not skipped');
}

const output2 = await ng('add', '@angular/localize@latest');
if (output2.stdout.includes('Skipping installation: Package already installed')) {
throw new Error('Installation should not have been skipped');
}

const output3 = await ng('add', '@angular/[email protected]');
if (output3.stdout.includes('Skipping installation: Package already installed')) {
throw new Error('Installation should not have been skipped');
Expand Down

0 comments on commit 21a49e6

Please sign in to comment.