MCPcopy
hub / github.com/angular/angular / createComp

Function createComp

packages/core/test/linker/ng_module_integration_spec.ts:131–144  ·  view source on GitHub ↗
(compType: Type<T>, moduleType: Type<any>)

Source from the content-addressed store, hash-verified

129 }
130
131 function createComp<T>(compType: Type<T>, moduleType: Type<any>): ComponentFixture<T> {
132 const componentDef = (compType as any).ɵcmp;
133 if (componentDef) {
134 // Since we avoid Components/Directives/Pipes recompiling in case there are no overrides, we
135 // may face a problem where previously compiled defs available to a given
136 // Component/Directive are cached in TView and may become stale (in case any of these defs
137 // gets recompiled). In order to avoid this problem, we force fresh TView to be created.
138 componentDef.TView = null;
139 }
140
141 createModule(moduleType, injector);
142
143 return TestBed.createComponent(compType);
144 }
145
146 describe('errors', () => {
147 it('should error when exporting a directive that was neither declared nor imported', () => {

Callers 1

Calls 2

createModuleFunction · 0.70
createComponentMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…