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

LibJS: Implement Temporal.PlainDateTime.prototype.dayOfYear

This commit is contained in:
Idan Horowitz 2021-07-30 00:15:47 +03:00 committed by Linus Groh
parent c41b7b27c9
commit 0800c2a958
3 changed files with 32 additions and 0 deletions

View file

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