<commit_before>import { createProjectFromAsset } from '../../utils/assets';
import { setRegistry } from '../../utils/packages';
import { ng } from '../../utils/process';
import { isPrereleaseCli } from '../../utils/project';
import { expectToFail } from '../../utils/utils';

export default async function () {
  let restoreRegistry: (() => Promise<void>) | undefined;
  try {
    restoreRegistry = await createProjectFromAsset('13.0-project', true);
    await setRegistry(true);

    const extraArgs = ['--force'];
    if (isPrereleaseCli()) {
      extraArgs.push('--next');
    }

    // Update Angular from v12 to 13
    const { stdout } = await ng('update', ...extraArgs);
    if (!/@angular\/core\s+13\.\d\.\d+ -> 14\.\d\.\d+\s+ng update @angular\/core@14/.test(stdout)) {
      // @angular/core                      13.x.x -> 14.x.x         ng update @angular/core@14
      throw new Error(
        `Output didn't match "@angular/core                      13.x.x -> 14.x.x         ng update @angular/core@14". OUTPUT: \n` +
          stdout,
      );
    }

    const { message } = await expectToFail(() => ng('update', '@angular/cli', ...extraArgs));
    if (
      !message.includes(
        `Updating multiple major versions of '@angular/cli' at once is not supported`,
      )
    ) {
      throw new Error(
        `Expected error message to include "Updating multiple major versions of '@angular/cli' at once is not supported" but didn't. OUTPUT: \n` +
          message,
      );<commit_msg>ci: fix update test to work when `@angular/cli` and `@angular/core` majors diverge<commit_after>import { createProjectFromAsset } from '../../utils/assets';
import { setRegistry } from '../../utils/packages';
import { ng } from '../../utils/process';
import { isPrereleaseCli } from '../../utils/project';
import { expectToFail } from '../../utils/utils';

export default async function () {
  let restoreRegistry: (() => Promise<void>) | undefined;
  try {
    restoreRegistry = await createProjectFromAsset('13.0-project', true);
    await setRegistry(true);

    const extraArgs = ['--force'];
    if (isPrereleaseCli()) {
      extraArgs.push('--next');
    }

    // Update Angular from v13 to 14
    const { stdout } = await ng('update', ...extraArgs);
    if (!/@angular\/core\s+13\.\d\.\d+ -> 14\.\d\.\d+\s+ng update @angular\/core@14/.test(stdout)) {
      // @angular/core                      13.x.x -> 14.x.x         ng update @angular/core@14
      throw new Error(
        `Output didn't match "@angular/core                      13.x.x -> 14.x.x         ng update @angular/core@14". OUTPUT: \n` +
          stdout,
      );
    }

    const { message } = await expectToFail(() => ng('update', '@angular/core', ...extraArgs));
    if (
      !message.includes(
        `Updating multiple major versions of '@angular/core' at once is not supported`,
      )
    ) {
      throw new Error(
        `Expected error message to include "Updating multiple major versions of '@angular/core' at once is not supported" but didn't. OUTPUT: \n` +
          message,
      );
{'fraction_non_alphanumeric': 0.16774821544451654, 'fraction_numerical': 0.016223231667748216, 'mean_word_length': 2.2658898305084745, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5999051', 'n_tokens_mistral': 941, 'n_tokens_neox': 891, 'n_words': 255}