mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:27:35 +00:00
LibJS: Implement Temporal.PlainTime.prototype.toLocaleString()
This commit is contained in:
parent
9f78a957d5
commit
6987e326d8
3 changed files with 35 additions and 0 deletions
|
@ -0,0 +1,18 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 0", () => {
|
||||
expect(Temporal.PlainTime.prototype.toLocaleString).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const plainTime = new Temporal.PlainTime(18, 14, 47, 123, 456, 789);
|
||||
expect(plainTime.toLocaleString()).toBe("18:14:47.123456789");
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("this value must be a Temporal.PlainTime object", () => {
|
||||
expect(() => {
|
||||
Temporal.PlainTime.prototype.toLocaleString.call("foo");
|
||||
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainTime");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue