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?
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?
Share Improve this question asked Apr 12, 2014 at 12:25 Sam MikesSam Mikes 10.8k3 gold badges43 silver badges47 bronze badges1 Answer
Reset to default 18Found 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