Optionaldisable: boolean
When true (or any other truthy value), disables fake timer detection so
_isFakeTimersEnabled always returns false. When false (or any other falsy value),
(re-)enables detection. When undefined, restores the default (detection enabled).
// Disable fake timer detection -- this library will never treat a patched
// setTimeout.clock as an indication that fake timers are active
setDisableFakeTimersDetection(true);
// Re-enable detection
setDisableFakeTimersDetection(false);
// Restore the default (detection enabled)
setDisableFakeTimersDetection();
Enables or disables this library's automatic detection of Sinon-style fake timers (a patched
setTimeoutexposing a.clockproperty). By default (and when this function has never been called, or has been called withundefined) detection remains active -- this is the existing / historical behavior, so any global that patchessetTimeoutand happens to also expose a.clockproperty (not necessarily Sinon) will still be treated as fake timers and change this library's internal scheduling (eg. using a0mstimeout "hop" instead of a microtask when deferring a queued continuation). Passingtruedisables the detection so it always behaves as though fake timers are not present (real microtask / timer scheduling is always used), which avoids that false-positive fingerprinting risk for consumers who don't rely on it. Passingfalsere-enables detection.