mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 21:32:38 +02:00
refactor(v2): cleanup console output (#4979)
* refactor(v2): cleanup console output * fix jest issue Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
8501db78a1
commit
41d9288e3d
86 changed files with 382 additions and 339 deletions
|
@ -35,12 +35,12 @@ describe('docsClientUtils', () => {
|
|||
expect(() =>
|
||||
getActivePlugin(data, '/', {failfast: true}),
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"Can't find active docs plugin for pathname=/, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: /ios, /android"`,
|
||||
`"Can't find active docs plugin for \\"/\\" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: /ios, /android"`,
|
||||
);
|
||||
expect(() =>
|
||||
getActivePlugin(data, '/xyz', {failfast: true}),
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"Can't find active docs plugin for pathname=/xyz, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: /ios, /android"`,
|
||||
`"Can't find active docs plugin for \\"/xyz\\" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: /ios, /android"`,
|
||||
);
|
||||
|
||||
const activePluginIos: ActivePlugin = {
|
||||
|
|
|
@ -57,7 +57,7 @@ export function getActivePlugin(
|
|||
|
||||
if (!activePlugin && options.failfast) {
|
||||
throw new Error(
|
||||
`Can't find active docs plugin for pathname=${pathname}, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(
|
||||
`Can't find active docs plugin for "${pathname}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(
|
||||
allPluginDatas,
|
||||
)
|
||||
.map((plugin) => plugin.path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue