mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 00:57:44 +00:00
LibJS: Allow string as parameter in Temporal's round() / total()
This is a normative change in the Temporal spec.
See: 1f0c586
This commit is contained in:
parent
93ee922027
commit
d0c29c9735
9 changed files with 199 additions and 89 deletions
|
@ -29,6 +29,16 @@ describe("correct behavior", () => {
|
|||
}).epochNanoseconds
|
||||
).toBe(1800000000000n);
|
||||
});
|
||||
|
||||
test("string argument is implicitly converted to options object", () => {
|
||||
const zonedDateTime = new Temporal.ZonedDateTime(
|
||||
1111111111111n,
|
||||
new Temporal.TimeZone("UTC")
|
||||
);
|
||||
expect(
|
||||
zonedDateTime.round("second").equals(zonedDateTime.round({ smallestUnit: "second" }))
|
||||
).toBeTrue();
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue