Skip to content

Commit

Permalink
All tests assume America/NewYork timezone (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
GillesDebunne authored Jun 5, 2020
1 parent c05a90f commit ec8e731
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 4 additions & 6 deletions test/datetime/diff.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,10 @@ test("DateTime#diff handles fractional days as fractions of those specific days"
});

test("DateTime#diff is precise for lower order units", () => {
if (DateTime.local().zoneName === "America/New_York") {
// spring forward skips one hour
expect(
diffObjs({ year: 2016, month: 5, day: 5 }, { year: 2016, month: 1, day: 1 }, "hours")
).toEqual({ hours: 2999 });
}
// spring forward skips one hour
expect(
diffObjs({ year: 2016, month: 5, day: 5 }, { year: 2016, month: 1, day: 1 }, "hours")
).toEqual({ hours: 2999 });
});

test("DateTime#diff passes through options", () => {
Expand Down
6 changes: 2 additions & 4 deletions test/datetime/zone.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,8 @@ test("Etc/GMT zones work even though V8 does not support them", () => {
//------

test("The local zone does local stuff", () => {
if (DateTime.local().zoneName === "America/New_York") {
expect(DateTime.local(2016, 8, 6).offsetNameLong).toBe("Eastern Daylight Time");
expect(DateTime.local(2016, 8, 6).offsetNameShort).toBe("EDT");
}
expect(DateTime.local(2016, 8, 6).offsetNameLong).toBe("Eastern Daylight Time");
expect(DateTime.local(2016, 8, 6).offsetNameShort).toBe("EDT");
});

//------
Expand Down

0 comments on commit ec8e731

Please sign in to comment.