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

Method finalize

packages/core/testing/src/test_bed_compiler.ts:426–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 3

_recordImportsMethod · 0.45
testModuleRefMethod · 0.45

Calls 8

compileTypesSyncMethod · 0.95
compileTestModuleMethod · 0.95
applyTransitiveScopesMethod · 0.95
runInitializersMethod · 0.80
getMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected