MCPcopy Create free account
hub / github.com/angular/angular / driveXi18n

Method driveXi18n

packages/compiler-cli/test/ngtsc/env.ts:520–532  ·  view source on GitHub ↗
(format: string, outputFileName: string, locale: string | null = null)

Source from the content-addressed store, hash-verified

518 }
519
520 driveXi18n(format: string, outputFileName: string, locale: string | null = null): void {
521 if (isNgpTestMode()) {
522 throw new Error('driveXi18n is not supported in NGP mode.');
523 }
524 const errorSpy = jasmine.createSpy('consoleError').and.callFake(console.error);
525 const args = [...this.commandLineArgs, `--i18nFormat=${format}`, `--outFile=${outputFileName}`];
526 if (locale !== null) {
527 args.push(`--locale=${locale}`);
528 }
529 const exitCode = mainXi18n(args, errorSpy);
530 expect(errorSpy).not.toHaveBeenCalled();
531 expect(exitCode).toEqual(0);
532 }
533
534 driveHmr(fileName: string, className: string): string | null {
535 const {rootNames, options} = readNgcCommandLineAndConfiguration(this.commandLineArgs);

Callers 1

xi18n_spec.tsFile · 0.80

Calls 3

isNgpTestModeFunction · 0.90
mainXi18nFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected