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

Function setup

packages/router/test/with_platform_navigation.spec.ts:569–592  ·  view source on GitHub ↗
(providers: Provider[] = [])

Source from the content-addressed store, hash-verified

567 const navigation = window.navigation as Navigation;
568
569 async function setup(providers: Provider[] = []) {
570 TestBed.configureTestingModule({
571 providers: [
572 provideRouter(
573 [
574 {
575 path: 'guarded',
576 canActivate: [() => inject(Router).parseUrl('/search?q=redirected')],
577 children: [],
578 },
579 {path: '**', children: []},
580 ],
581 withExperimentalPlatformNavigation(),
582 ),
583 {provide: PlatformLocation, useClass: BrowserPlatformLocation},
584 {provide: PlatformNavigation, useFactory: () => navigation},
585 ...providers,
586 ],
587 });
588 const router = TestBed.inject(Router);
589 router.initialNavigation();
590 await timeout();
591 return router;
592 }
593
594 it(
595 'resets focus by default',

Calls 8

provideRouterFunction · 0.90
injectFunction · 0.90
timeoutFunction · 0.90
initialNavigationMethod · 0.80
injectMethod · 0.65
parseUrlMethod · 0.45

Tested by

no test coverage detected