MCPcopy
hub / github.com/angular/angular / setUpRouter

Function setUpRouter

packages/router/test/activated_route_injector.spec.ts:66–77  ·  view source on GitHub ↗
(routes: Route[])

Source from the content-addressed store, hash-verified

64 let strategy: CustomReuseStrategy;
65
66 async function setUpRouter(routes: Route[]): Promise<RouterTestingHarness> {
67 TestBed.configureTestingModule({
68 providers: [
69 provideRouter(routes, ɵwithActivatedRouteInjectors()),
70 {provide: RouteReuseStrategy, useClass: CustomReuseStrategy},
71 ],
72 });
73
74 router = TestBed.inject(Router);
75 strategy = TestBed.inject(RouteReuseStrategy) as CustomReuseStrategy;
76 return await RouterTestingHarness.create();
77 }
78
79 it('should create and destroy local injector for routes with ɵUseActivatedRouteInjector', async () => {
80 const harness = await setUpRouter([

Calls 4

provideRouterFunction · 0.90
injectMethod · 0.65
createMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…