Skip to content

Commit

Permalink
Merge pull request #1488 from VynceMontgomery/patch-1
Browse files Browse the repository at this point in the history
Clarify behavior of useFakeTimers
  • Loading branch information
mroderick committed Jul 15, 2017
2 parents 717ebf7 + a6a2b8c commit e742268
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 e742268

Please sign in to comment.