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
For me what fixed this error was inside of my component's ngOnDestroy, I wrapped my store dispatch and my unsubscribe in a try catch.
ngOnDestroy(): void {
try {
this.store.dispatch(new foo.Bar(this.testThing()));
if(this.fooBarSubscription) {
this.fooBarSubscription.unsubscribe();
}
} catch (error) {
this.store.dispatch(new foo.Bar(this.testThing()));
}
}