Skip to content

Commit

Permalink
RelativeTime test fails on last day of the month (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
GillesDebunne authored Jun 5, 2020
1 parent 19b161a commit 918cecd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/datetime/relative.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ test("DateTime#toRelativeCalendar uses the calendar", () => {
});

test("DateTime#toRelativeCalendar picks the correct unit with no options", () => {
expect(
DateTime.local()
.plus({ days: 1 })
.toRelativeCalendar()
).toBe("tomorrow");
const now = DateTime.local();
const isLastDayOfMonth = now.endOf("month").day === now.day;
expect(now.plus({ days: 1 }).toRelativeCalendar()).toBe(
isLastDayOfMonth ? "next month" : "tomorrow"
);
});

test("DateTime#toRelativeCalendar returns null when used on an invalid date", () => {
Expand Down

0 comments on commit 918cecd

Please sign in to comment.