()
| 424 | } |
| 425 | |
| 426 | finalize(): NgModuleRef<any> { |
| 427 | // One last compile |
| 428 | this.compileTypesSync(); |
| 429 | |
| 430 | // Create the testing module itself. |
| 431 | this.compileTestModule(); |
| 432 | |
| 433 | this.applyTransitiveScopes(); |
| 434 | |
| 435 | this.applyProviderOverrides(); |
| 436 | |
| 437 | // Patch previously stored `styles` Component values (taken from ɵcmp), in case these |
| 438 | // Components have `styleUrls` fields defined and template override was requested. |
| 439 | this.patchComponentsWithExistingStyles(); |
| 440 | |
| 441 | // Clear the componentToModuleScope map, so that future compilations don't reset the scope of |
| 442 | // every component. |
| 443 | this.componentToModuleScope.clear(); |
| 444 | |
| 445 | const parentInjector = this.platform.injector; |
| 446 | this.testModuleRef = new NgModuleRef(this.testModuleType, parentInjector, []); |
| 447 | |
| 448 | // ApplicationInitStatus.runInitializers() is marked @internal to core. |
| 449 | // Cast it to any before accessing it. |
| 450 | (this.testModuleRef.injector.get(ApplicationInitStatus) as any).runInitializers(); |
| 451 | return this.testModuleRef; |
| 452 | } |
| 453 | |
| 454 | /** |
| 455 | * @internal |
no test coverage detected