lib/mock.js
function MockDate (value) {
  // A MockDate constructs an inner date and exposes its methods.
  var innerDate
  // If a value is specified, use it to construct a real date.
  if (arguments.length) {
    innerDate = new timers.Date(value)

  // If time isn't currently mocked, construct a real date for the real time.
  } else if (global.Date === timers.Date) {
    innerDate = new timers.Date()

  // If there's no value and time is mocked, use the current mock time.
  } else {
    innerDate = new timers.Date(mock.time._CURRENT_TIME)
  }
  Object.defineProperty(this, '_INNER_DATE', {
    enumerable: false,
    value: innerDate
  })
}
function MockDate (value) {
  // A MockDate constructs an inner date and exposes its methods.
  var innerDate
  // If a value is specified, use it to construct a real date.
  if (arguments.length) {
    innerDate = new timers.Date(value)

  // If time isn't currently mocked, construct a real date for the real time.
  } else if (global.Date === timers.Date) {
    innerDate = new timers.Date()

  // If there's no value and time is mocked, use the current mock time.
  } else {
    innerDate = new timers.Date(mock.time._CURRENT_TIME)
  }
  Object.defineProperty(this, '_INNER_DATE', {
    enumerable: false,
    value: innerDate
  })
}
Construct a `MockDate` using a `Date` constructor value.