I am having issues writing a stub for router.navigate in angular 2. I currently have the below stub written. Which is what shows up in the angular docs.
@Injectable
export class RouterStub {
navigate(commands: any[], extras?: NavigationExtras) { }
However, when I use this stub I get the following error.
TypeError: this.router.navigate is not a function
And my usage of navigate is as follows.
let summaryLink = ['/summary', this.client.id, this.client.lastName];
this.router.navigate(summaryLink);
Any help would be appreciated.
Just an update... I was able to get this test working using a non TestBed method that I found referenced here. However, if anyone is able to figure out how I can get this test working with the TestBed method I would appreciate the help. Thank you