Skip to content

Commit

Permalink
Merge pull request chaijs#22 from debitoor/compare-dates
Browse files Browse the repository at this point in the history
Comparison of Dates
  • Loading branch information
eagleeye authored and koddsson committed Dec 2, 2015
1 parent 71b8eaf commit cea5b39
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/chai-subset.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ function compare(expected, actual) {
});
}

if(expected instanceof Date && actual instanceof Date) {
return expected.getTime() === actual.getTime();
}

return Object.keys(expected).every(function (key) {
var eo = expected[key];
var ao = actual[key];
Expand Down

0 comments on commit cea5b39

Please sign in to comment.