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

Method canMatch

packages/router/test/integration/guards.spec.ts:2250–2257  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2248 class DelayedGuard {
2249 static delayedExecutions = 0;
2250 canMatch() {
2251 return of(true).pipe(
2252 switchMap((v) => new Promise((r) => setTimeout(r, 10)).then(() => v)),
2253 tap(() => {
2254 DelayedGuard.delayedExecutions++;
2255 }),
2256 );
2257 }
2258 }
2259 const router = TestBed.inject(Router);
2260 const delayedGuardSpy = spyOn(TestBed.inject(DelayedGuard), 'canMatch');

Callers

nothing calls this directly

Calls 2

setTimeoutFunction · 0.85
thenMethod · 0.65

Tested by

no test coverage detected