I have an angular 6 application and I am trying to unit test a component where I inject the Router. In my ngOnInit method I reference this.router.url and work with it.
So now I am attempting to write a jasmine unit test and I cannot set the router.url property because it "is a constant ot read only property". I am currently mocking the router like this.
mockRouter = jasmine.createSpyObj<Router>("router", ["navigate", "navigateByUrl"]);
What else do I need to set to properly mock the url value in my test?