* Run the compiler to completion, and assert that no errors occurred.
(customTransformers?: CustomTransformers)
| 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. |
no test coverage detected