mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:18:13 +00:00
LibJS: Implement Temporal.PlainDateTime.prototype.calendar
This commit is contained in:
parent
78acc976a6
commit
aa2c8b6b91
3 changed files with 45 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
describe("correct behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
const calendar = { hello: "friends" };
|
||||
const plainDateTime = new Temporal.PlainDateTime(0, 1, 1, 0, 0, 0, 0, 0, 0, calendar);
|
||||
expect(plainDateTime.calendar).toBe(calendar);
|
||||
});
|
||||
});
|
||||
|
||||
test("errors", () => {
|
||||
test("this value must be a Temporal.PlainDateTime object", () => {
|
||||
expect(() => {
|
||||
Reflect.get(Temporal.PlainDateTime.prototype, "calendar", "foo");
|
||||
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainDateTime");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue