diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-11-18 10:30:31 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-29 22:48:46 +0000 |
commit | 75b2a09a2f39ecea2386780521946d6ffe9a855a (patch) | |
tree | 5eab2ec6faf06fc6600c18ccfe2c1d03445ad95e /Userland/Libraries/LibJS/Tests | |
parent | 6dbdfb6ba1deb222a7324c4f4088cb85c613ab1a (diff) | |
download | serenity-75b2a09a2f39ecea2386780521946d6ffe9a855a.zip |
LibJS: Implement a nearly empty Intl.DateTimeFormat object
This adds plumbing for the Intl.DateTimeFormat object, constructor, and
prototype.
Note that unlike other Intl objects, the Intl.DateTimeFormat object has
a LibUnicode structure as a base. This is to prevent wild amounts of
code duplication between LibUnicode, Intl.DateTimeFormat, and other
not-yet-defined Intl structures, because there's 12 fields shared
between them.
Diffstat (limited to 'Userland/Libraries/LibJS/Tests')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.@@toStringTag.js | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.js | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.@@toStringTag.js b/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.@@toStringTag.js new file mode 100644 index 0000000000..be1abf847d --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.@@toStringTag.js @@ -0,0 +1,3 @@ +test("basic functionality", () => { + expect(Intl.DateTimeFormat.prototype[Symbol.toStringTag]).toBe("Intl.DateTimeFormat"); +}); diff --git a/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.js b/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.js new file mode 100644 index 0000000000..685320f262 --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.js @@ -0,0 +1,5 @@ +describe("normal behavior", () => { + test("length is 0", () => { + expect(Intl.DateTimeFormat).toHaveLength(0); + }); +}); |