While testing a component that subscribes to router params, all tests pass and everything works smoothly. However, upon checking the console, there is an error message:
Error during cleanup of component ApplicationViewComponent localConsole.(anonymous function) @ context.js:232
Do you have any idea why this error occurs?
I found that removing the unsubscribe()
from the ngOnDestroy()
method resolves the error.
Is karma/jasmine automatically handling unsubscribe()
?
Below are the details of the component and its associated tests.
Component
Copying code...
Component spec file
Copying code...
service.stub
Copying code...