MCPcopy Create free account
hub / github.com/angular/angular / setUpRouter

Function setUpRouter

packages/router/test/activated_route_injector.spec.ts:79–90  ·  view source on GitHub ↗
(routes: InternalRoute[])

Source from the content-addressed store, hash-verified

77 let strategy: CustomReuseStrategy;
78
79 async function setUpRouter(routes: InternalRoute[]): Promise<RouterTestingHarness> {
80 TestBed.configureTestingModule({
81 providers: [
82 provideRouter(routes, ɵwithRouterResources()),
83 {provide: RouteReuseStrategy, useClass: CustomReuseStrategy},
84 ],
85 });
86
87 router = TestBed.inject(Router);
88 strategy = TestBed.inject(RouteReuseStrategy) as CustomReuseStrategy;
89 return await RouterTestingHarness.create();
90 }
91
92 it('should create and destroy local injector for routes with resources', async () => {
93 const harness = await setUpRouter([

Calls 4

provideRouterFunction · 0.90
injectMethod · 0.65
createMethod · 0.65

Tested by

no test coverage detected