From 5573efa3bd5ac31ad65e581816babe911ebec112 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 23 Aug 2021 23:23:53 +0100 Subject: LibJS: Implement Temporal.PlainDateTime.prototype.toPlainYearMonth() --- .../PlainDateTime.prototype.toPlainYearMonth.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainDateTime/PlainDateTime.prototype.toPlainYearMonth.js (limited to 'Userland/Libraries/LibJS/Tests/builtins') diff --git a/Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainDateTime/PlainDateTime.prototype.toPlainYearMonth.js b/Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainDateTime/PlainDateTime.prototype.toPlainYearMonth.js new file mode 100644 index 0000000000..023470357d --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainDateTime/PlainDateTime.prototype.toPlainYearMonth.js @@ -0,0 +1,13 @@ +describe("correct behavior", () => { + test("length is 0", () => { + expect(Temporal.PlainDateTime.prototype.toPlainYearMonth).toHaveLength(0); + }); + + test("basic functionality", () => { + const plainDateTime = new Temporal.PlainDateTime(2021, 7, 6, 18, 14, 47); + const plainYearMonth = plainDateTime.toPlainYearMonth(); + expect(plainYearMonth.calendar).toBe(plainDateTime.calendar); + expect(plainYearMonth.year).toBe(2021); + expect(plainYearMonth.month).toBe(7); + }); +}); -- cgit v1.2.3