Updated api calls to use mocks in throttle tests.
Updated expected delay between calls to be at least 4000ms when throttle delay is set to 5000ms.
When using throttle with 5000ms between 3 requests, the exact delay was sometime 4000 + 6000 or 5000 + 5000.
function setTimeout documentation:
/**
* Schedules execution of a one-time `callback` after `delay` milliseconds. The `callback` will likely not be invoked in precisely `delay` milliseconds.
* Node.js makes no guarantees about the exact timing of when callbacks will fire, nor of their ordering. The callback will be called as close as possible to the time specified.
* When `delay` is larger than `2147483647` or less than `1`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer.
* * If `callback` is not a function, a [TypeError](https://nodejs.org/api/errors.html#class-typeerror) will be thrown.
* * @SInCE v0.0.1
* */
Throttle tests
Updated api calls to use mocks in throttle tests. Updated expected delay between calls to be at least 4000ms when throttle delay is set to 5000ms. When using throttle with 5000ms between 3 requests, the exact delay was sometime 4000 + 6000 or 5000 + 5000.
function setTimeout documentation: