summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests/builtins
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-08-23 23:23:53 +0100
committerAndreas Kling <kling@serenityos.org>2021-08-24 01:53:30 +0200
commit5573efa3bd5ac31ad65e581816babe911ebec112 (patch)
tree527af8073c21740d5910341566da498adbeea313 /Userland/Libraries/LibJS/Tests/builtins
parented5ae7b093521cb47d09623fc149988c7963c6f9 (diff)
downloadserenity-5573efa3bd5ac31ad65e581816babe911ebec112.zip
LibJS: Implement Temporal.PlainDateTime.prototype.toPlainYearMonth()
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins')
-rw-r--r--Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainDateTime/PlainDateTime.prototype.toPlainYearMonth.js13
1 files changed, 13 insertions, 0 deletions
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);
+ });
+});