1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:27:35 +00:00

LibJS: Implement Intl.Locale.prototype.numeric

This commit is contained in:
Timothy Flynn 2021-09-02 10:50:51 -04:00 committed by Linus Groh
parent d7825f3680
commit bdf36575c8
3 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,16 @@
describe("errors", () => {
test("called on non-Locale object", () => {
expect(() => {
Intl.Locale.prototype.numeric;
}).toThrowWithMessage(TypeError, "Not a Intl.Locale object");
});
});
describe("normal behavior", () => {
test("basic functionality", () => {
expect(new Intl.Locale("en").numeric).toBeFalse();
expect(new Intl.Locale("en-u-kn-true").numeric).toBeTrue();
expect(new Intl.Locale("en", { numeric: false }).numeric).toBeFalse();
expect(new Intl.Locale("en-u-kn-false", { numeric: true }).numeric).toBeTrue();
});
});