mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
LibJS: Implement Temporal.PlainDateTime.prototype.weekOfYear
This commit is contained in:
committed by
Linus Groh
parent
0800c2a958
commit
d4e9d572f5
Notes:
sideshowbarker
2024-07-18 07:45:51 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/d4e9d572f5d Pull-request: https://github.com/SerenityOS/serenity/pull/9097 Reviewed-by: https://github.com/linusg ✅
@@ -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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user