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

Function fakeSetInterval

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

Source from the content-addressed store, hash-verified

156}
157
158function fakeSetInterval(
159 callback: string | ((...args: unknown[]) => unknown),
160 delay = 0,
161 ...args: unknown[]
162): number {
163 assertIsCallbackFunction(callback, "setInterval");
164 if (!time) throw new TimeError("Cannot set interval: time is not faked");
165 return setTimer(callback, delay, args, true);
166}
167
168function fakeClearInterval(id?: unknown) {
169 if (!time) throw new TimeError("Cannot clear interval: time is not faked");

Callers 1

time_test.tsFile · 0.85

Calls 2

assertIsCallbackFunctionFunction · 0.85
setTimerFunction · 0.70

Tested by

no test coverage detected