LibJS: Implement Temporal.ZonedDateTime.prototype.millisecond

This commit is contained in:
Linus Groh 2021-08-04 22:58:16 +01:00 committed by Andreas Kling
parent 9d9ab492df
commit 752b3eb0c0
Notes: sideshowbarker 2024-07-18 07:27:52 +09:00
3 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,15 @@
describe("correct behavior", () => {
test("basic functionality", () => {
const timeZone = new Temporal.TimeZone("UTC");
const zonedDateTime = new Temporal.ZonedDateTime(123000000n, timeZone);
expect(zonedDateTime.millisecond).toBe(123);
});
});
test("errors", () => {
test("this value must be a Temporal.ZonedDateTime object", () => {
expect(() => {
Reflect.get(Temporal.ZonedDateTime.prototype, "millisecond", "foo");
}).toThrowWithMessage(TypeError, "Not a Temporal.ZonedDateTime");
});
});