I've got a unit test like this:
(parsed.date).should.equal(new Date(2006,06,18,18,07));
Which fails with this message:
AssertionError: expected 2006-07-19T00:07:00.000Z to be 2006-07-19T00:07:00.000Z
+ expected - actual
What am I doing wrong?
Found it - I should be comparing dates with eql
not equal
.
Working code:
(parsed.date).should.eql(new Date(2006,06,18,18,07));
More at this link: https://github.com/visionmedia/should.js/issues/63 specifically comment https://github.com/visionmedia/should.js/issues/63#issuecomment-27626023
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With