@sinonjs/fake-timers is a JavaScript implementation that can fake timer APIs like setTimeout, setInterval, and requestAnimationFrame, controlled by a clock instance with methods such as tick and runAll. It is useful for testing code that depends on scheduling and time passing without waiting in real time, and it can also provide faked Date and, in some environments, performance, nextTick, and process.hrtime.
Project status
- The source (sinonjs/fake-timers) appears actively maintained, with an upstream push as recently as 2026-08-04, and recent version updates published in 2026.
- The apparent updates cadence is fairly steady, with published updates in early to mid 2026 (v15.3.1 on 2026-04-10, v15.3.2 on 2026-04-11, v15.4.0 on 2026-05-05). No newer published update is listed after v15.4.0 as of today (2026-08-12).
AI summary generated
Recent updates
v15.4.0
No publisher release notes were provided for v15.4.0, so the documented change set cannot be verified against the code. The diff shows additions for Temporal API support (including new typing surface and runtime behavior), plus CI/type-check improvements and a regression fix related to uninstall behavior during an in-flight tickAsync.
v15.3.2
v15.3.2 has no publisher release notes, but the changelog indicates this version changes typings and upgrades eslint configuration. The code diff shows a large TypeScript typing refactor (notably any to unknown in callback argument types) plus tooling and dev dependency updates (new eslint.config.js, eslint-config bump, and lockfile updates).
v15.3.1
Release v15.3.1 was published on 2026-04-10, but no release notes were provided by the publisher. As a result, there is no documented information about new functionality, bug fixes, security fixes, or breaking changes in this release.
v2.1.1
v2.1.1 is a small hotfix release focused on correcting how lolex forwards arguments to callbacks passed to nextTick. The release notes specifically call out support for passing parameters in nextTick and reference issue #122.
v2.1.0
v2.1.0 adds support for process.nextTick (mocked microtask semantics), and introduces an option to automatically advance mocked time by attaching to real system timers. It also updates hrtime progression when intervals tick. The release notes are brief and do not fully describe a few behavioral details revealed by the code, especially around nextTick execution and timer error propagation.
BreakingFeaturesv2.0.0
v2.0.0 refactors lolex to use a new config-object based install(config) API, and adds support for faking performance.now in environments that provide Performance. It also adjusts tick() behavior so that timer scheduling remains consistent even when setSystemTime is called and the timer callback throws.
BreakingFeaturesv1.6.0
v1.6.0 updates lolex with a common Sinon.JS eslint configuration, extends `lolex.install` to accept a Date object as the initial epoch, and refactors the source by removing a wrapper function. It also fixes a typo in the `clock.runAll` error.
Featuresv1.5.2
v1.5.2 is described in the release notes as a minor React Native compatibility fix. The actual code changes include adjustments to how timers are scheduled, plus small documentation and build/test metadata updates.
v1.4.0
This release (v1.4.0) documents two functional changes, it adds a new `clock.next()` method and updates `parseTime()` related messaging to better match the existing behavior. The code diff also includes several smaller internal logic and build/test script changes that are not called out in the release notes.
Featuresv1.5.0
This release adds a new clock method, `runAll()`, intended to run all pending scheduled timers until none remain. It also introduces Node.js `process.hrtime()` emulation in the fake clock so tests can measure high-resolution time. The codebase was also reorganized (source rename and updated build tooling) and several additional clock APIs/options appear in the implementation.
Featuresv1.5.1
v1.5.1 is a patch release focused on timer correctness, especially around parsing string delays and improving error messages for mismatched clear* calls. It also adds a guard for custom clock install contexts that may not include a `process` object, plus updates to tooling and the build/lint setup.
v1.3.2
v1.3.2 fixes an issue that could break setImmediate polyfills when used alongside lolex and Sinon.JS. This release is focused on restoring correct polyfill behavior rather than introducing new features.