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

Method driveMain

packages/compiler-cli/test/ngtsc/env.ts:249–275  ·  view source on GitHub ↗

* Run the compiler to completion, and assert that no errors occurred.

(customTransformers?: CustomTransformers)

Source from the content-addressed store, hash-verified

247 * Run the compiler to completion, and assert that no errors occurred.
248 */
249 driveMain(customTransformers?: CustomTransformers): void {
250 const errorSpy = jasmine.createSpy('consoleError').and.callFake(console.error);
251 let reuseProgram: {program: Program | undefined} | undefined = undefined;
252 if (this.multiCompileHostExt !== null) {
253 reuseProgram = {
254 program: this.oldProgram || undefined,
255 };
256 }
257 const exitCode = main(
258 this.commandLineArgs,
259 errorSpy,
260 undefined,
261 customTransformers,
262 reuseProgram,
263 this.changedResources,
264 );
265
266 if (errorSpy.calls.count() > 0) {
267 console.error('>>>', errorSpy.calls.allArgs().join('\n'));
268 }
269 expect(errorSpy).not.toHaveBeenCalled();
270
271 expect(exitCode).toBe(0);
272 if (this.multiCompileHostExt !== null) {
273 this.oldProgram = reuseProgram!.program!;
274 }
275 }
276
277 /**
278 * Run the compiler to completion, and return any `ts.Diagnostic` errors that may have occurred.

Calls 4

mainFunction · 0.90
errorMethod · 0.65
joinMethod · 0.65
countMethod · 0.45

Tested by

no test coverage detected