mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:07:34 +00:00
LibJS: Remove duplicated error message from ErrorTypes.h
ErrorType::IntlInvalidCode has almost exactly the same message as ErrorType::OptionIsNotValidValue. Remove it, as all uses of the former are semantically interchangeable with the latter.
This commit is contained in:
parent
21c4922ac0
commit
fdedb3ab33
3 changed files with 8 additions and 9 deletions
|
@ -2,25 +2,25 @@ describe("errors", () => {
|
|||
test("invalid language", () => {
|
||||
expect(() => {
|
||||
new Intl.DisplayNames("en", { type: "language" }).of("hello!");
|
||||
}).toThrowWithMessage(RangeError, "'hello!' is not a valid value for option type language");
|
||||
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option language");
|
||||
});
|
||||
|
||||
test("invalid region", () => {
|
||||
expect(() => {
|
||||
new Intl.DisplayNames("en", { type: "region" }).of("hello!");
|
||||
}).toThrowWithMessage(RangeError, "'hello!' is not a valid value for option type region");
|
||||
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option region");
|
||||
});
|
||||
|
||||
test("invalid script", () => {
|
||||
expect(() => {
|
||||
new Intl.DisplayNames("en", { type: "script" }).of("hello!");
|
||||
}).toThrowWithMessage(RangeError, "'hello!' is not a valid value for option type script");
|
||||
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option script");
|
||||
});
|
||||
|
||||
test("invalid currency", () => {
|
||||
expect(() => {
|
||||
new Intl.DisplayNames("en", { type: "currency" }).of("hello!");
|
||||
}).toThrowWithMessage(RangeError, "'hello!' is not a valid value for option type currency");
|
||||
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option currency");
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue