message: Add tests for non-string arguments for `parse`
diff: @@ -5,6 +5,24 @@ var assert = require('power-assert')
  var parse = require('./')
  describe('parse', function () {
  + describe('date argument', function () {
  + it('returns a clone of the given date', function () {
  + var date = new Date(2016, 0, 1)
  + var dateClone = parse(date)
  + dateClone.setFullYear(2015)
  + assert.deepEqual(date, new Date(2016, 0, 1))
  + })
  + })
  +
  + describe('timestamp argument', function () {
  + it('creates a date from the timestamp', function () {
  + var timestamp = new Date(2016, 0, 1, 23, 30, 45, 123).getTime()
  + var result = parse(timestamp)
  + assert.deepEqual(result, new Date(2016, 0, 1, 23, 30, 45, 123))
  + })
  + })
  +
  + describe('string argument', function () {
  describe('centuries', function () {
  it('parses YY', function () {
  var result = parse('20')
  @@ -202,6 +220,7 @@ describe('parse', function () {
  })
  })
  })
  + })
  describe('failure', function () {
  it('the fallback to `new Date` if the string is not an ISO formatted date', function () {
  @@ -209,4 +228,24 @@ describe('parse', function () {
  assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11))
  })
  })
  +
  + describe('invalid argument', function () {
  + it('returns Invalid Date if argument is non-date string', function () {
  + var result = parse('abc')
  + assert(result instanceof Date)
  + assert(isNaN(result))
  + })
  +
  + it('returns Invalid Date if argument is NaN', function () {
  + var result = parse(NaN)
  + assert(result instanceof Date)
  + assert(isNaN(result))
  + })
  +
  + it('returns Invalid Date if argument is Invalid Date', function () {
  + var result = parse(new Date(NaN))
  + assert(result instanceof Date)
  + assert(isNaN(result))
  + })
  + })
  })
  