mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibJS: Implement Temporal.Now
This commit is contained in:
parent
f1c3e3d71a
commit
f2c19f96f8
Notes:
github-actions[bot]
2024-11-25 12:33:55 +00:00
Author: https://github.com/trflynn89
Commit: f2c19f96f8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2557
Reviewed-by: https://github.com/shannonbooth ✅
12 changed files with 252 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 0", () => {
|
||||
expect(Temporal.Now.plainTimeISO).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const plainTime = Temporal.Now.plainTimeISO();
|
||||
expect(plainTime).toBeInstanceOf(Temporal.PlainTime);
|
||||
expect(plainTime.calendarId).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("invalid time zone name", () => {
|
||||
expect(() => {
|
||||
Temporal.Now.plainTimeISO("foo");
|
||||
}).toThrowWithMessage(RangeError, "Invalid time zone name 'foo");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue