Skip to content

Commit 560151c

Browse files
authored
Update fake-timers.md (#2332)
1 parent b60e270 commit 560151c

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test code using them.
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-
For standalone usage of fake timers it is recommended to use [lolex](https://github.com/sinonjs/lolex) package instead. It provides the same
14+
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
1515
set of features (Sinon uses it under the hood) and was previously extracted from Sinon.JS.
1616

1717
```javascript
@@ -50,20 +50,19 @@ Starts the clock at the UNIX epoch (timestamp of `0`).
5050
#### `var clock = sinon.useFakeTimers(now);`
5151

5252
As above, but rather than starting the clock with a timestamp of 0, start at the provided timestamp `now`.
53-
54-
*Since `sinon@2.0.0`*
55-
5653
You can also pass in a Date object, and its `getTime()` will be used for the starting timestamp.
5754

5855
#### `var clock = sinon.useFakeTimers(config);`
5956

60-
As above, but allows further configuration options, some of which are:
57+
As above, but allows further configuration options.
6158

6259
- `config.now` - *Number/Date* - installs lolex with the specified unix epoch (default: 0)
6360
- `config.toFake` - *String[ ]* - an array with explicit function names to fake. By default lolex will automatically fake all methods *except* `process.nextTick`. You could, however, still fake `nextTick` by providing it explicitly
6461
- `config.shouldAdvanceTime` - *Boolean* - tells lolex to increment mocked time automatically based on the real system time shift (default: false). When used in conjunction with `config.toFake`, it will only work if `'setInterval'` is included in `config.toFake`.
62+
- **`config.global`** - *Object* - use `global` instead of the usual global object. This is useful if you use JSDOM along with Node.
6563

66-
Please refer to the `lolex.install` [documentation](https://github.com/sinonjs/lolex#var-clock--lolexinstallconfig) for the full set of features available and more elaborate explanations.
64+
The options are basically all of those supported by the `install()` method of our `fake-timers` library, with the sole exception of `global`.
65+
Please refer to the `fakeTimers.install` [documentation](https://github.com/sinonjs/fake-timers/#var-clock--faketimersinstallconfig) for the full set of features available and more elaborate explanations.
6766

6867
*Since `sinon@3.0.0`*
6968

0 commit comments

Comments
 (0)