test: strengthen internal types (#7488)

This commit is contained in:
Joshua Chen 2022-05-25 15:38:44 +08:00 committed by GitHub
parent d50fe3b670
commit cd21a31005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 67 additions and 55 deletions

View file

@ -42,7 +42,7 @@ describe('normalizePluginOptions', () => {
it('throws for invalid options', () => {
const options = {foo: 1};
expect(() =>
normalizePluginOptions(Joi.object({foo: Joi.string()}), options),
normalizePluginOptions(Joi.object<object>({foo: Joi.string()}), options),
).toThrowErrorMatchingInlineSnapshot(`""foo" must be a string"`);
});
@ -90,7 +90,10 @@ describe('normalizeThemeConfig', () => {
it('throws for invalid options', () => {
const themeConfig = {foo: 1, bar: 1};
expect(() =>
normalizeThemeConfig(Joi.object({foo: Joi.string()}), themeConfig),
normalizeThemeConfig(
Joi.object<object>({foo: Joi.string()}),
themeConfig,
),
).toThrowErrorMatchingInlineSnapshot(`""foo" must be a string"`);
});