Browse Source

LibJS/Tests: Add test for Temporal.Instant.prototype.valueOf()

Linus Groh 4 years ago
parent
commit
9d7e391f94

+ 7 - 0
Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.valueOf.js

@@ -0,0 +1,7 @@
+test("errors", () => {
+    test("throws TypeError", () => {
+        expect(() => {
+            new Temporal.Instant(0n).valueOf();
+        }).toThrowWithMessage(TypeError, "Cannot convert Temporal.Instant to a primitive value");
+    });
+});