Skip to content

Commit

Permalink
Clarify behavior of useFakeTimers
Browse files Browse the repository at this point in the history
I no longer use sinon, so I don't know if it still has the apparent bugs that cause me to look for this documentation, but here's the clarification I wanted at the time.
  • Loading branch information
VynceMontgomery committed Jul 15, 2017
1 parent 717ebf7 commit a6a2b8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/release-source/release/fake-timers.md
Expand Up @@ -58,9 +58,11 @@ You can also pass in a Date object, and its `getTime()` will be used for the sta

#### `var clock = sinon.useFakeTimers([now, ]prop1, prop2, ...);`

Sets the clock start timestamp and names functions to fake.
Sets the clock start timestamp and names functions to fake. If the first argument is not numeric, it sets the clock to 0 and treats all arguments as names of functions to fake.

Possible functions are `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval`, `setImmediate`, `clearImmediate` and `Date`. Can also be called without the timestamp.
Possible functions are `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval`, `setImmediate`, `clearImmediate` and `Date`. Any functions not listed continue to use the original version of the function, including the actual time for the timestamp. This can have surprising results and should be done with care.

Note that if no functions are listed, the default behavior is to replace all eligible functions.


#### `clock.tick(ms);`
Expand Down

0 comments on commit a6a2b8c

Please sign in to comment.