MCPcopy
hub / github.com/angular/angular / setupRouter

Function setupRouter

packages/router/test/create_url_tree.spec.ts:598–613  ·  view source on GitHub ↗
(defaultQueryParamsHandling: QueryParamsHandling)

Source from the content-addressed store, hash-verified

596
597describe('defaultQueryParamsHandling', () => {
598 async function setupRouter(defaultQueryParamsHandling: QueryParamsHandling): Promise<Router> {
599 TestBed.configureTestingModule({
600 providers: [
601 provideRouter(
602 [{path: '**', component: class {}}],
603 withRouterConfig({
604 defaultQueryParamsHandling,
605 }),
606 ),
607 ],
608 });
609
610 const router = TestBed.inject(Router);
611 await router.navigateByUrl('/initial?a=1');
612 return router;
613 }
614
615 it('can use "merge" as the default', async () => {
616 const router = await setupRouter('merge');

Callers 1

Calls 5

provideRouterFunction · 0.90
withRouterConfigFunction · 0.90
injectMethod · 0.65
navigateByUrlMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…