1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:57:44 +00:00

LibJS: Implement Temporal.PlainDateTime.prototype.hour

This commit is contained in:
Idan Horowitz 2021-07-30 00:02:50 +03:00 committed by Linus Groh
parent f93b6ea58c
commit f553ab3104
3 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,14 @@
describe("correct behavior", () => {
test("basic functionality", () => {
const plainDateTime = new Temporal.PlainDateTime(2021, 7, 30, 1);
expect(plainDateTime.hour).toBe(1);
});
});
test("errors", () => {
test("this value must be a Temporal.PlainDateTime object", () => {
expect(() => {
Reflect.get(Temporal.PlainDateTime.prototype, "hour", "foo");
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainDateTime");
});
});