Преглед на файлове

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

Linus Groh преди 4 години
родител
ревизия
9d7e391f94
променени са 1 файла, в които са добавени 7 реда и са изтрити 0 реда
  1. 7 0
      Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.valueOf.js

+ 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");
+    });
+});