When using the following configuration for a test fixture, I get complaints that the tag cannot be found. Substituting the MockSelectionToolComponent
directly in AppModule
works fine, so must be something else...
// Add the imported module to the imports array in beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [MockSelectionToolComponent],
imports: [
AppModule
]
}).overrideModule(AppModule, {
remove: {
declarations: [SelectionToolComponent]
}
}).compileComponents();
fixture = TestBed.createComponent(MappingComponent);
component = fixture.componentInstance;
fixture.detectChanges();
component.initialiseMap();
});
Error: Template parse errors: 'app-selection-tool' is not a known element:
TestBed.configureTestingModule({...})
module to addentryComponents
? – Delphina