Skip to content

Commit

Permalink
Add an isDate test for Invalid Date
Browse files Browse the repository at this point in the history
  • Loading branch information
leshakoss authored and kossnocorp committed Jun 7, 2018
1 parent b97beb8 commit 1da5f75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/isDate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@
* //=> true
*
* @example
* // For a value
* // For an invalid date:
* var result = isDate(new Date(NaN))
* //=> true
*
* @example
* // For some value:
* var result = isDate('2014-02-31')
* //=> false
*
* @example
* // For a object
* // For an object:
* var result = isDate({})
* //=> false
*/
Expand Down
4 changes: 4 additions & 0 deletions src/isDate/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ describe('isDate', function () {
assert(isDate(new Date()))
})

it('returns true if the given value is an Invalid Date', function () {
assert(isDate(new Date(NaN)))
})

context('with date passed from another iframe', function () {
afterEach(function () {
const iframe = document.getElementById('iframe')
Expand Down

0 comments on commit 1da5f75

Please sign in to comment.