我有这样的单元测试:
(parsed.date).should.equal(new Date(2006,06,18,18,07));此消息失败:
AssertionError: expected 2006-07-19T00:07:00.000Z to be 2006-07-19T00:07:00.000Z
+ expected - actual我做错了什么?
发布于 2014-04-12 12:26:09
找到了-我应该把日期和eql而不是equal比较一下。
工作代码:
(parsed.date).should.eql(new Date(2006,06,18,18,07));更多链接:https://github.com/visionmedia/should.js/issues/63专门评论https://github.com/visionmedia/should.js/issues/63#issuecomment-27626023
https://stackoverflow.com/questions/23030353
复制相似问题