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

Function delayPromise

packages/router/test/integration/guards.spec.ts:937–942  ·  view source on GitHub ↗
(delay: number)

Source from the content-addressed store, hash-verified

935 });
936
937 function delayPromise(delay: number): Promise<boolean> {
938 let resolve: (val: boolean) => void;
939 const promise = new Promise<boolean>((res) => (resolve = res));
940 setTimeout(() => resolve(true), delay);
941 return promise;
942 }
943
944 it('works', async () => {
945 const router = TestBed.inject(Router);

Callers 1

guardsIntegrationSuiteFunction · 0.85

Calls 2

setTimeoutFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected