Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make NaN comparison more precise
  • Loading branch information
shvaikalesh committed Jun 17, 2018
commit bca121d38cfe5bc0de5c11198dcccdf2787040fe
2 changes: 1 addition & 1 deletion test/datetime/invalid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test('Invalid tell you why', () => {
});

test('Invalid DateTimes return invalid Dates', () => {
expect(organic1.toJSDate().valueOf()).toBeFalsy();
expect(organic1.toJSDate().valueOf()).toBe(NaN);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised this works, actually.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't work initially, was fixed by jestjs/jest#4917, that's why I updated jest.

});

test('Diffing invalid DateTimes creates invalid Durations', () => {
Expand Down