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

LibJS: Add yearOfWeek calendar methods and properties

This is a normative change in the Temporal spec.

See:
- 7fa4d18
- caa941d
This commit is contained in:
Luke Wilde 2022-12-26 00:58:43 +00:00 committed by Andreas Kling
parent 804baa42f9
commit fa1416987a
15 changed files with 294 additions and 126 deletions

View file

@ -0,0 +1,14 @@
describe("correct behavior", () => {
test("basic functionality", () => {
const date = new Temporal.PlainDate(2023, 1, 1);
expect(date.yearOfWeek).toBe(2022);
});
});
describe("errors", () => {
test("this value must be a Temporal.PlainDate object", () => {
expect(() => {
Reflect.get(Temporal.PlainDate.prototype, "yearOfWeek", "foo");
}).toThrowWithMessage(TypeError, "Not an object of type Temporal.PlainDate");
});
});