LibJS: Implement Temporal.PlainDateTime.prototype.weekOfYear

This commit is contained in:
Idan Horowitz
2021-07-30 00:17:41 +03:00
committed by Linus Groh
parent 0800c2a958
commit d4e9d572f5
Notes: sideshowbarker 2024-07-18 07:45:51 +09:00
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.weekOfYear).toBe(30);
});
});
test("errors", () => {
test("this value must be a Temporal.PlainDateTime object", () => {
expect(() => {
Reflect.get(Temporal.PlainDateTime.prototype, "weekOfYear", "foo");
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainDateTime");
});
});