mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
fix(validation): improve error messages for a few schemas (#6997)
* fix(validation): improve error messages for a few schemas * kick CI * fix test
This commit is contained in:
parent
d879cdca96
commit
f1bcdbff63
6 changed files with 114 additions and 44 deletions
|
@ -150,9 +150,11 @@ describe('normalizeDocsPluginOptions', () => {
|
|||
testValidate({
|
||||
remarkPlugins: [[{option1: '42'}, markdownPluginsFunctionStub]],
|
||||
}),
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"\\"remarkPlugins[0]\\" does not match any of the allowed types"`,
|
||||
);
|
||||
).toThrowErrorMatchingInlineSnapshot(`
|
||||
"\\"remarkPlugins[0]\\" does not look like a valid MDX plugin config. A plugin config entry should be one of:
|
||||
- A tuple, like \`[require(\\"rehype-katex\\"), { strict: false }]\`, or
|
||||
- A simple module, like \`require(\\"remark-math\\")\`"
|
||||
`);
|
||||
});
|
||||
|
||||
it('rejects invalid rehype plugin options', () => {
|
||||
|
@ -166,9 +168,11 @@ describe('normalizeDocsPluginOptions', () => {
|
|||
],
|
||||
],
|
||||
}),
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"\\"rehypePlugins[0]\\" does not match any of the allowed types"`,
|
||||
);
|
||||
).toThrowErrorMatchingInlineSnapshot(`
|
||||
"\\"rehypePlugins[0]\\" does not look like a valid MDX plugin config. A plugin config entry should be one of:
|
||||
- A tuple, like \`[require(\\"rehype-katex\\"), { strict: false }]\`, or
|
||||
- A simple module, like \`require(\\"remark-math\\")\`"
|
||||
`);
|
||||
});
|
||||
|
||||
it('rejects bad path inputs', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue