summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests/builtins
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-07-15 23:53:19 +0100
committerLinus Groh <mail@linusgroh.de>2021-07-16 01:07:01 +0100
commitb81331a1106e66c956462a82189ee26fb954a90f (patch)
tree5c8050b3c37ea3499f6a38a10bfb9daa5d422874 /Userland/Libraries/LibJS/Tests/builtins
parentdbdbfbeebc4d55d9759958d930e172e188abff87 (diff)
downloadserenity-b81331a1106e66c956462a82189ee26fb954a90f.zip
LibJS: Implement Temporal.Duration.prototype.seconds
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins')
-rw-r--r--Userland/Libraries/LibJS/Tests/builtins/Temporal/Duration/Duration.prototype.seconds.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Temporal/Duration/Duration.prototype.seconds.js b/Userland/Libraries/LibJS/Tests/builtins/Temporal/Duration/Duration.prototype.seconds.js
new file mode 100644
index 0000000000..510ab6e71b
--- /dev/null
+++ b/Userland/Libraries/LibJS/Tests/builtins/Temporal/Duration/Duration.prototype.seconds.js
@@ -0,0 +1,14 @@
+describe("correct behavior", () => {
+ test("basic functionality", () => {
+ const duration = new Temporal.Duration(0, 0, 0, 0, 0, 0, 123);
+ expect(duration.seconds).toBe(123);
+ });
+});
+
+test("errors", () => {
+ test("this value must be a Temporal.Duration object", () => {
+ expect(() => {
+ Reflect.get(Temporal.Duration.prototype, "seconds", "foo");
+ }).toThrowWithMessage(TypeError, "Not a Temporal.Duration");
+ });
+});