I\'m testing a component which subscribe router params. Every test pass and everything works fine. But if I look in the console, I can see an error:
Error
I'm in a similar situation where I want to test a function in my component outside the context of the component itself.
This is what worked for me:
afterEach(() => { spyOn(component, 'ngOnDestroy').and.callFake(() => { }); fixture.destroy(); });