diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-08-24 22:27:05 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-08-26 22:04:09 +0100 |
commit | 0fb4e8b749d8fcfdd70c146d34ceb054e33f9cf7 (patch) | |
tree | 6e976af6193e3c3a7a7750e422556d6539c3645a /Userland/Libraries/LibJS/Tests/builtins | |
parent | 137e98cb6f18e68b786efefece6a426e9fe6c188 (diff) | |
download | serenity-0fb4e8b749d8fcfdd70c146d34ceb054e33f9cf7.zip |
LibJS: Implement a nearly empty Intl.DisplayNames object
This adds plumbing for the Intl.DisplayNames object, constructor, and
prototype.
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.@@toStringTag.js | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.js | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.@@toStringTag.js b/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.@@toStringTag.js new file mode 100644 index 0000000000..2f393731c3 --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.@@toStringTag.js @@ -0,0 +1,3 @@ +test("basic functionality", () => { + expect(Intl.DisplayNames.prototype[Symbol.toStringTag]).toBe("Intl.DisplayNames"); +}); diff --git a/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.js b/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.js new file mode 100644 index 0000000000..8f1607575c --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.js @@ -0,0 +1,13 @@ +describe("errors", () => { + test("called without new", () => { + expect(() => { + Intl.DisplayNames(); + }).toThrowWithMessage(TypeError, "Intl.DisplayNames constructor must be called with 'new'"); + }); +}); + +describe("normal behavior", () => { + test("length is 2", () => { + expect(Intl.DisplayNames).toHaveLength(2); + }); +}); |