lib/mock.js
function getScheduler (isInterval) {
  return function (fn, time) {
    schedules.push({
      id: ++schedules.id,
      fn: fn,
      time: Date.now() + time,
      interval: isInterval ? time : false
    })
  }
}
function getScheduler (isInterval) {
  return function (fn, time) {
    schedules.push({
      id: ++schedules.id,
      fn: fn,
      time: Date.now() + time,
      interval: isInterval ? time : false
    })
  }
}
The `getScheduler` returns mocks for `setTimeout` and `setInterval`.