You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix documentation issue for fake-timers mentioned in #2625
The docs were out of sync with the fake-timers docs.
* Update dependencies before new patch version
Copy file name to clipboardexpand all lines: docs/release-source/release/fake-timers.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -58,9 +58,9 @@ You can also pass in a Date object, and its `getTime()` will be used for the sta
58
58
59
59
As above, but allows further configuration options.
60
60
61
-
-`config.now` - _Number/Date_ - installs lolex with the specified unix epoch (default: 0)
62
-
-`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
63
-
-`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`.
61
+
-`config.now` - _Number/Date_ - installs `fake-timers` with the specified unix epoch (default: 0)
62
+
-`config.toFake` - _String[]_ - an array with explicit function names to fake. By default `fake-timers` will automatically fake _all_ methods (changed in v19).
63
+
-`config.shouldAdvanceTime` - _Boolean_ - tells `fake-timers` 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`.
64
64
-**`config.global`** - _Object_ - use `global` instead of the usual global object. This is useful if you use JSDOM along with Node.
65
65
66
66
The options are basically all of those supported by the `install()` method of our `fake-timers` library, with the sole exception of `global`.
@@ -70,7 +70,7 @@ _Since `sinon@3.0.0`_
70
70
71
71
`var clock = sinon.useFakeTimers([now, ]prop1, prop2, ...)` is no longer supported. To define which methods to fake, please use `config.toFake`.
72
72
73
-
**Important note:** when faking `nextTick`, normal calls to `process.nextTick()`would not execute automatically as they would during normal event-loop phases. You would have to call either `clock.next()`, `clock.tick()`, `clock.runAll()` or `clock.runToLast()` (see example below). Please refer to the [lolex](https://github.com/sinonjs/lolex) documentation for more information.
73
+
**Important note:** when faking `nextTick`, normal calls to `process.nextTick()`will not execute automatically as they would during normal event-loop phases. You would have to call either `clock.next()`, `clock.tick()`, `clock.runAll()` or `clock.runToLast()`manually (see example below). You can easily work around this using the `config.toFake` option. Please refer to the [`fake-timers`](https://github.com/sinonjs/fake-timers) documentation for more information.
0 commit comments