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

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

This commit is contained in:
Linus Groh 2021-07-08 20:37:26 +01:00
parent 2e968700aa
commit 8d00504ff2
3 changed files with 51 additions and 0 deletions

View file

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