diff options
author | Linus Groh <mail@linusgroh.de> | 2021-07-15 23:53:19 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-07-16 01:07:01 +0100 |
commit | b81331a1106e66c956462a82189ee26fb954a90f (patch) | |
tree | 5c8050b3c37ea3499f6a38a10bfb9daa5d422874 /Userland/Libraries/LibJS/Tests/builtins | |
parent | dbdbfbeebc4d55d9759958d930e172e188abff87 (diff) | |
download | serenity-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.js | 14 |
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"); + }); +}); |