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

Method canMatch

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

Source from the content-addressed store, hash-verified

2251 class DelayedGuard {
2252 static delayedExecutions = 0;
2253 canMatch() {
2254 return of(true).pipe(
2255 switchMap((v) => new Promise((r) => setTimeout(r, 10)).then(() => v)),
2256 tap(() => {
2257 DelayedGuard.delayedExecutions++;
2258 }),
2259 );
2260 }
2261 }
2262 const router = TestBed.inject(Router);
2263 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