Skip to content

Commit

Permalink
bug: fix expecting an object to be a date succeeds (chaijs#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
despairblue authored and koddsson committed Dec 26, 2016
1 parent ac3c162 commit baaa129
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/chai-subset.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@
});
}

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

return Object.keys(expected).every(function (key) {
Expand Down

0 comments on commit baaa129

Please sign in to comment.