Skip to content

Commit 6c9f5c2

Browse files
authored
Add a notice that the Fake Timers API doc is incomplete (#2570)
1 parent 93db3ef commit 6c9f5c2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/release-source/release/fake-timers.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ breadcrumb: fake timers
66

77
Fake timers are synchronous implementations of `setTimeout` and friends that
88
Sinon.JS can overwrite the global functions with to allow you to more easily
9-
test code using them.
9+
test code using them. It also has utilities for working with `async`/Promise code.
1010

1111
Fake timers provide a `clock` object to pass time, which can also be used to control `Date` objects created through either `new Date();`
1212
or `Date.now();` (if supported by the browser).
1313

14+
> The separate Fake Timers project is constantly being added to and updated, and we have a hard time keeping these docs in sync! Therefore it might be better to just refer directly to the [fake-timer API reference][api reference], as that shows all it has to offer. The `clock` object is not wrapped, so everything `fake-timers` has to offer can be used through it.
15+
1416
For standalone usage of fake timers it is recommended to use [fake-timers](https://github.com/sinonjs/fake-timers) package instead. It provides the same
1517
set of features (Sinon uses it under the hood) and was previously extracted from Sinon.JS.
1618

@@ -39,6 +41,8 @@ set of features (Sinon uses it under the hood) and was previously extracted from
3941

4042
## Fake timers API
4143

44+
> This is just the most important subset of the available methods. Refer to the [Fake Timers API reference][api reference] for the full _smørgåsbord_ of available methods.
45+
4246
#### `var clock = sinon.useFakeTimers();`
4347

4448
Causes Sinon to replace the global `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval`, `setImmediate`, `clearImmediate`, `process.hrtime`, `performance.now`(when available) and `Date` with a custom implementation which is bound to the returned `clock` object.
@@ -176,3 +180,5 @@ The `runAllAsync()` will also break the event loop, allowing any scheduled promi
176180
Restore the faked methods.
177181

178182
Call in e.g. `tearDown`.
183+
184+
[api reference]: https://github.com/sinonjs/fake-timers#api-reference

0 commit comments

Comments
 (0)