MCPcopy Create free account
hub / github.com/denoland/std / abort

Method abort

testing/time.ts:580–587  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

578 return await new Promise((resolve, reject) => {
579 let timer: ReturnType<typeof setTimeout> | null = null;
580 const abort = () =>
581 FakeTime
582 .restoreFor(() => {
583 if (timer) clearTimeout(timer);
584 })
585 .then(() =>
586 reject(new DOMException("Delay was aborted.", "AbortError"))
587 );
588 const done = () => {
589 signal?.removeEventListener("abort", abort);
590 resolve();

Callers 2

time_test.tsFile · 0.45
fakeAbortSignalTimeoutFunction · 0.45

Calls 1

restoreForMethod · 0.80

Tested by

no test coverage detected