mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibJS: Implement Temporal.ZonedDateTime.prototype.timeZone
This commit is contained in:
parent
d022b74d33
commit
49c5f87274
Notes:
sideshowbarker
2024-07-18 07:37:53 +09:00
Author: https://github.com/linusg
Commit: 49c5f87274
Pull-request: https://github.com/SerenityOS/serenity/pull/9160
Reviewed-by: https://github.com/IdanHo ✅
3 changed files with 30 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
describe("correct behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const zonedDateTime = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
expect(zonedDateTime.timeZone).toBe(timeZone);
|
||||
});
|
||||
});
|
||||
|
||||
test("errors", () => {
|
||||
test("this value must be a Temporal.ZonedDateTime object", () => {
|
||||
expect(() => {
|
||||
Reflect.get(Temporal.ZonedDateTime.prototype, "timeZone", "foo");
|
||||
}).toThrowWithMessage(TypeError, "Not a Temporal.ZonedDateTime");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue