angular/packages/compiler-cli/test/compliance/update_all_goldens.js
Kristiyan Kostadinov 9cc52b9b85 feat(core): support TypeScript 5.2 (#51334)
Updates the project to support TypeScript 5.2.

PR Close #51334
2023-08-18 07:55:16 -07:00

37 lines
1.3 KiB
JavaScript

#!/usr/bin/env node
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-console
import shelljs from 'shelljs';
const {exec} = shelljs;
process.stdout.write('Gathering all partial golden update targets');
const queryCommand =
`yarn bazel query --output label 'filter('golden.update', kind(nodejs_binary, //packages/compiler-cli/test/compliance/test_cases:*))'`;
const allUpdateTargets =
exec(queryCommand, {silent: true}).trim().split('\n').map(test => test.trim());
process.stdout.clearLine();
process.stdout.cursorTo(0);
for (const [index, target] of allUpdateTargets.entries()) {
const progress = `${index + 1} / ${allUpdateTargets.length}`;
process.stdout.write(`[${progress}] Running: ${target}`);
const commandResult = exec(`yarn bazel run ${target}`, {silent: true});
process.stdout.clearLine();
process.stdout.cursorTo(0);
if (commandResult.code) {
console.error(`[${progress}] Failed run: ${target}`);
console.group();
console.error(commandResult.stdout || commandResult.stderr);
console.groupEnd();
} else {
console.log(`[${progress}] Successful run: ${target}`);
}
}