 RouterTestingModule ngmodule   Sets up the router to be used for testing. See more... class RouterTestingModule {
  static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule>
} Description The modules sets up the router to be used for testing. It provides spy implementations of Location, LocationStrategy, and NgModuleFactoryLoader. Static methods     withRoutes()        static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule> Parameters     routes  Routes      config  ExtraOptions  Optional. Default is undefined.     Returns ModuleWithProviders<RouterTestingModule>      Providers    Provider      ROUTER_PROVIDERS     { provide: Location, useClass: SpyLocation }     { provide: LocationStrategy, useClass: MockLocationStrategy }     { provide: NgModuleFactoryLoader, useClass: SpyNgModuleFactoryLoader }     {
    provide: Router,
    useFactory: setupTestingRouter,
    deps: [
        UrlSerializer, ChildrenOutletContexts, Location, NgModuleFactoryLoader, Compiler, Injector,
        ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()]
    ]
}     { provide: PreloadingStrategy, useExisting: NoPreloading }     provideRoutes([])     Usage notes Example beforeEach(() => {
  TestBed.configureTestModule({
    imports: [
      RouterTestingModule.withRoutes(
        [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]
      )
    ]
  });
}); 

    
{'path': 'public/docs/angular~9/api/router/testing/routertestingmodule.html', 'source': 'DevDocs.IO'}