У меня есть компонент, который получает компонентный компонент компонента для динамического создания в качестве дочернего элемента.
let componentFactory = this.componentFactoryResolver.resolveComponentFactory(componentToCreate);
this.componentReference = this.target.createComponent(componentFactory);
Я пытаюсь написать unit test и передать некоторый TestComponent для его создания и рендеринга.
TestBed
.configureTestingModule(<any>{
declarations: [MyAwesomeDynamicComponentRenderer, TestHostComponent],
entryComponents: [TestComponent],
});
Есть листинг для "any", потому что configureTestingModule ожидает TestModuleMetadata, у которого нет entryComponents, но я получаю ошибку: "No component factory найдено для TestComponent".
Как я могу предоставить entryComponents для TestBed?