MCPcopy
hub / github.com/jestjs/jest / _fakeSetInterval

Method _fakeSetInterval

packages/jest-fake-timers/src/legacyFakeTimers.ts:542–565  ·  view source on GitHub ↗
(
    callback: Callback,
    intervalDelay?: number,
    ...args: Array<unknown>
  )

Source from the content-addressed store, hash-verified

540 }
541
542 private _fakeSetInterval(
543 callback: Callback,
544 intervalDelay?: number,
545 ...args: Array<unknown>
546 ) {
547 if (this._disposed) {
548 return null;
549 }
550
551 if (intervalDelay == null) {
552 intervalDelay = 0;
553 }
554
555 const uuid = this._uuidCounter++;
556
557 this._timers.set(String(uuid), {
558 callback: () => callback.apply(null, args),
559 expiry: this._now + intervalDelay,
560 interval: intervalDelay,
561 type: 'interval',
562 });
563
564 return this._timerConfig.idToRef(uuid);
565 }
566
567 private _fakeSetTimeout(
568 callback: Callback,

Callers

nothing calls this directly

Calls 2

setMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected