mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17:35 +00:00
LibJS: Implement Temporal.Now.plainTimeISO()
This commit is contained in:
parent
2aa2c56891
commit
5e64156fce
4 changed files with 44 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
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.calendar.id).toBe("iso8601");
|
||||
});
|
||||
|
||||
test("custom time zone", () => {
|
||||
const timeZone = {
|
||||
getOffsetNanosecondsFor() {
|
||||
return 86400000000000;
|
||||
},
|
||||
};
|
||||
const plainTime = Temporal.Now.plainTimeISO();
|
||||
const plainTimeWithOffset = Temporal.Now.plainTimeISO(timeZone);
|
||||
// FIXME: Compare these in a sensible way
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue