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

Function fakeSetTimeout

testing/time.ts:141–149  ·  view source on GitHub ↗
(
  callback: string | ((...args: unknown[]) => unknown),
  delay = 0,
  ...args: unknown[]
)

Source from the content-addressed store, hash-verified

139}
140
141function fakeSetTimeout(
142 callback: string | ((...args: unknown[]) => unknown),
143 delay = 0,
144 ...args: unknown[]
145): number {
146 assertIsCallbackFunction(callback, "setTimeout");
147 if (!time) throw new TimeError("Cannot set timeout: time is not faked");
148 return setTimer(callback, delay, args, false);
149}
150
151function fakeClearTimeout(id?: unknown) {
152 if (!time) throw new TimeError("Cannot clear timeout: time is not faked");

Callers 2

time_test.tsFile · 0.85
fakeAbortSignalTimeoutFunction · 0.85

Calls 2

assertIsCallbackFunctionFunction · 0.85
setTimerFunction · 0.70

Tested by

no test coverage detected