mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
test: strengthen internal types (#7488)
This commit is contained in:
parent
d50fe3b670
commit
cd21a31005
15 changed files with 67 additions and 55 deletions
|
@ -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"`);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue