summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests/builtins
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-09-01 00:20:45 +0100
committerLinus Groh <mail@linusgroh.de>2021-09-01 15:11:35 +0100
commite845e7c8147805611a931cb82a96e9f98b0aa4de (patch)
treed251b78aee8cbef95d4685caf0d19d557f51dd15 /Userland/Libraries/LibJS/Tests/builtins
parent38bef3e28ea6aa417dba7f6dbbf0d686d8241c87 (diff)
downloadserenity-e845e7c8147805611a931cb82a96e9f98b0aa4de.zip
LibJS: Throw TypeError if Instant.prototype.round() options is undefined
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/943018f
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins')
-rw-r--r--Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.round.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.round.js b/Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.round.js
index 58d98a3f15..b6c74f20c4 100644
--- a/Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.round.js
+++ b/Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.round.js
@@ -30,6 +30,13 @@ describe("errors", () => {
}).toThrowWithMessage(TypeError, "Not a Temporal.Instant");
});
+ test("missing options object", () => {
+ expect(() => {
+ const instant = new Temporal.Instant(1n);
+ instant.round();
+ }).toThrowWithMessage(TypeError, "Required options object is missing or undefined");
+ });
+
test("invalid rounding mode", () => {
expect(() => {
const instant = new Temporal.Instant(1n);