I have a component, let's call it MyComponent. It's using my.component.html as the templateUrl.
@Component({
selector: "my-component",
templateUrl: "./my.component.html",
styleUrls: ["./my.component.css"]
})
I am writing a test (spec) for this component. Since, it'susing an external template, I am calling compileComponents after configureTestingModule.
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MyComponent ]
})
.compileComponents()
}));
While running the test, I am getting this error -
Failed to load my.component.html
The app runs absolutely okay with npm start and serve the templates as it should be. It's just the test which is failing with given setup. What I am doing wrong?
I am following this tutorial.