Skip to content

Commit

Permalink
Update tests to use valid dates
Browse files Browse the repository at this point in the history
It seems that only V8 supports out-of-bound dates like `31st of November`. Let's use correct dates in tests.
  • Loading branch information
zbraniecki authored and rxaviers committed Jan 26, 2018
1 parent 871098c commit c699083
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/relative-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("relative-time", function() {
expect(relativeTime.format(new Date("2016-01-01 00:00"))).to.equal("3 months ago");
expect(relativeTime.format(new Date("2016-03-01 00:00"))).to.equal("last month");
expect(relativeTime.format(new Date("2016-05-01 00:00"))).to.equal("next month");
expect(relativeTime.format(new Date("2016-11-31 23:59"))).to.equal("in 8 months");
expect(relativeTime.format(new Date("2016-12-01 23:59"))).to.equal("in 8 months");

sinon.useFakeTimers(new Date("2017-01-12 18:30").getTime());
expect(relativeTime.format(new Date("2016-12-29 18:30"))).to.equal("last month");
Expand Down

0 comments on commit c699083

Please sign in to comment.