LibJS: Implement Temporal.PlainDate.prototype.dayOfYear

This commit is contained in:
Idan Horowitz 2021-07-23 18:00:12 +03:00 committed by Linus Groh
commit d561535ac9
Notes: sideshowbarker 2024-07-18 08:27:40 +09:00
5 changed files with 43 additions and 0 deletions

View file

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