1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:27:35 +00:00

LibJS: Implement Temporal.Calendar.prototype.toString()

This commit is contained in:
Linus Groh 2021-07-14 21:12:37 +01:00
parent e01c6adab4
commit 83bbbbe567
3 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,18 @@
describe("correct behavior", () => {
test("length is 0", () => {
expect(Temporal.Calendar.prototype.toString).toHaveLength(0);
});
test("basic functionality", () => {
const calendar = new Temporal.Calendar("iso8601");
expect(calendar.toString()).toBe("iso8601");
});
});
test("errors", () => {
test("this value must be a Temporal.Calendar object", () => {
expect(() => {
Temporal.Calendar.prototype.toString.call("foo");
}).toThrowWithMessage(TypeError, "Not a Temporal.Calendar");
});
});