MCPcopy Index your code
hub / github.com/angular/angular / driveMain

Method driveMain

packages/compiler-cli/test/ngtsc/env.ts:260–281  ·  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

258 * Run the compiler to completion, and assert that no errors occurred.
259 */
260 driveMain(customTransformers?: CustomTransformers): void {
261 const errorSpy = jasmine.createSpy('consoleError').and.callFake(console.error);
262 let reuseProgram: {program: Program | undefined} | undefined = undefined;
263 if (this.multiCompileHostExt !== null) {
264 reuseProgram = {
265 program: this.oldProgram || undefined,
266 };
267 }
268 const exitCode = main(
269 this.commandLineArgs,
270 errorSpy,
271 undefined,
272 customTransformers,
273 reuseProgram,
274 this.changedResources,
275 );
276 expect(errorSpy).not.toHaveBeenCalled();
277 expect(exitCode).toBe(0);
278 if (this.multiCompileHostExt !== null) {
279 this.oldProgram = reuseProgram!.program!;
280 }
281 }
282
283 /**
284 * Run the compiler to completion, and return any `ts.Diagnostic` errors that may have occurred.

Calls 1

mainFunction · 0.90

Tested by

no test coverage detected