I\'ve run into missing messages in other unit tests, but just to have a nice isolated example, I created an AuthGuard that checks if a user is
this worked for me
describe('navigateExample', () => { it('navigate Example', () => { const routerstub: Router = TestBed.get(Router); spyOn(routerstub, 'navigate'); component.navigateExample(); }); });