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

LibJS: Leverage PrepareTemporalFields in ToTemporalTimeRecord

This is an editorial change in the Temporal spec.

See: b5ba981
This commit is contained in:
Linus Groh 2022-06-14 21:41:00 +01:00
parent 6cc69bbd8e
commit e96df3b7a7
5 changed files with 52 additions and 45 deletions

View file

@ -92,10 +92,16 @@ describe("errors", () => {
test("argument is an invalid plain time-like object", () => {
expect(() => {
new Temporal.PlainTime().with({});
}).toThrowWithMessage(TypeError, "Invalid plain time-like object");
}).toThrowWithMessage(
TypeError,
"Object must have at least one of the following properties: hour, microsecond, millisecond, minute, nanosecond, second"
);
expect(() => {
new Temporal.PlainTime().with({ foo: 1, bar: 2 });
}).toThrowWithMessage(TypeError, "Invalid plain time-like object");
}).toThrowWithMessage(
TypeError,
"Object must have at least one of the following properties: hour, microsecond, millisecond, minute, nanosecond, second"
);
});
test("error when coercing property to number", () => {