1

In my angular 4 app, I am writing a test case for a method which navigates to a different route. In my test case I am importing RouterTestingModule.withRoutes and passing the route.

const testRoutes: Routes = [ { path: 'sampleApp', component: SampleComponent}];
 imports: [RouterTestingModule.withRoutes(testRoutes)]

This doesn't seem to work I still get the error,

angular jasmine ERROR: 'Unhandled Promise rejection:', 'Cannot match any routes. URL Segment ...

How can I resolve this.

user1015388
  • 1,143
  • 3
  • 14
  • 33

0 Answers0