mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 02:38:59 +00:00
LibJS: Separate validation of roundingIncrement option
This is an editorial change in the temporal spec.
See: 712c449
This commit is contained in:
parent
7b3ddd5e15
commit
d2e4da62c8
Notes:
sideshowbarker
2024-07-17 09:48:50 +09:00
Author: https://github.com/dlarocque
Commit: d2e4da62c8
Pull-request: https://github.com/SerenityOS/serenity/pull/23656
Reviewed-by: https://github.com/shannonbooth ✅
6 changed files with 125 additions and 58 deletions
|
@ -122,5 +122,23 @@ describe("errors", () => {
|
|||
expect(() => {
|
||||
plainTime.round({ smallestUnit: "second", roundingIncrement: Infinity });
|
||||
}).toThrowWithMessage(RangeError, "inf is not a valid value for option roundingIncrement");
|
||||
expect(() => {
|
||||
plainTime.round({ smallestUnit: "hours", roundingIncrement: 24 });
|
||||
}).toThrowWithMessage(RangeError, "24 is not a valid value for option roundingIncrement");
|
||||
expect(() => {
|
||||
plainTime.round({ smallestUnit: "minutes", roundingIncrement: 60 });
|
||||
}).toThrowWithMessage(RangeError, "60 is not a valid value for option roundingIncrement");
|
||||
expect(() => {
|
||||
plainTime.round({ smallestUnit: "seconds", roundingIncrement: 60 });
|
||||
}).toThrowWithMessage(RangeError, "60 is not a valid value for option roundingIncrement");
|
||||
expect(() => {
|
||||
plainTime.round({ smallestUnit: "milliseconds", roundingIncrement: 1000 });
|
||||
}).toThrowWithMessage(RangeError, "1000 is not a valid value for option roundingIncrement");
|
||||
expect(() => {
|
||||
plainTime.round({ smallestUnit: "microseconds", roundingIncrement: 1000 });
|
||||
}).toThrowWithMessage(RangeError, "1000 is not a valid value for option roundingIncrement");
|
||||
expect(() => {
|
||||
plainTime.round({ smallestUnit: "nanoseconds", roundingIncrement: 1000 });
|
||||
}).toThrowWithMessage(RangeError, "1000 is not a valid value for option roundingIncrement");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue