1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:37:34 +00:00

LibJS: Implement Temporal.ZonedDateTime.prototype.hoursInDay

This commit is contained in:
Luke Wilde 2021-11-03 16:21:58 +00:00 committed by Linus Groh
parent 23ef6e1a9e
commit 84f79d4c51
4 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,15 @@
describe("correct behavior", () => {
test("basic functionality", () => {
const timeZone = new Temporal.TimeZone("UTC");
const zonedDateTime = new Temporal.ZonedDateTime(1625614921000000000n, timeZone);
expect(zonedDateTime.hoursInDay).toBe(24);
});
});
describe("errors", () => {
test("this value must be a Temporal.ZonedDateTime object", () => {
expect(() => {
Reflect.get(Temporal.ZonedDateTime.prototype, "hoursInDay", "foo");
}).toThrowWithMessage(TypeError, "Not an object of type Temporal.ZonedDateTime");
});
});