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
Copy file name to clipboardExpand all lines: docs/release-source/release/fake-timers.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,12 @@ As above, but allows further configuration options.
59
59
60
60
-`config.now` - _Number/Date_ - installs `fake-timers` with the specified unix epoch (default: 0)
61
61
-`config.toFake` - _String[]_ - an array with explicit function names to fake. By default `fake-timers` will automatically fake _all_ methods (changed in v19).
62
+
-`config.toNotFake` - _String[]_ - an array with explicit function names to **not** fake.
63
+
-`config.loopLimit` - _Number_ - the maximum number of timers that will be run when calling `runAll()` before assuming an infinite loop and throwing an error (default: 1000).
62
64
-`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`.
65
+
-`config.advanceTimeDelta` - _Number_ - increment (in ms) used when `shouldAdvanceTime` is true (default: 20).
66
+
-`config.shouldClearNativeTimers` - _Boolean_ - if set to `true`, `fake-timers` will clear any native timers that were already scheduled when the fake timers are installed (default: false).
67
+
-`config.ignoreMissingTimers` - _Boolean_ - if set to `true`, `fake-timers` will not throw an error if a method to fake is missing from the environment (default: false).
63
68
-**`config.global`** - _Object_ - use `global` instead of the usual global object. This is useful if you use JSDOM along with Node.
64
69
65
70
The options are basically all of those supported by the `install()` method of our `fake-timers` library, with the sole exception of `global`.
@@ -178,6 +183,32 @@ This makes it easier to run asynchronous tests to completion without worrying ab
178
183
179
184
The `runAllAsync()` will also break the event loop, allowing any scheduled promise callbacks to execute _before_ running the timers.
0 commit comments