mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +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
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`transformImage plugin fail if image does not exist 1`] = `"Image packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/fixtures/img/doesNotExist.png used in packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/fixtures/fail.md not found."`;
|
||||
|
||||
exports[`transformImage plugin fail if image url is absent 1`] = `"Markdown image url is mandatory. filePath=packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/fixtures/noUrl.md"`;
|
||||
exports[`transformImage plugin fail if image url is absent 1`] = `"Markdown image URL is mandatory in \\"packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/fixtures/noUrl.md\\" file"`;
|
||||
|
||||
exports[`transformImage plugin pathname protocol 1`] = `
|
||||
"
|
||||
|
|
|
@ -57,9 +57,9 @@ async function ensureImageFileExist(imagePath, sourceFilePath) {
|
|||
async function processImageNode(node, {filePath, staticDir}) {
|
||||
if (!node.url) {
|
||||
throw new Error(
|
||||
`Markdown image url is mandatory. filePath=${toMessageRelativeFilePath(
|
||||
`Markdown image URL is mandatory in "${toMessageRelativeFilePath(
|
||||
filePath,
|
||||
)}`,
|
||||
)}" file`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`transformAsset plugin fail if asset url is absent 1`] = `"Markdown link url is mandatory. filePath=packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/fixtures/noUrl.md, title=asset, line=1"`;
|
||||
exports[`transformAsset plugin fail if asset url is absent 1`] = `"Markdown link URL is mandatory in \\"packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/fixtures/noUrl.md\\" file (title: asset, line: 1)."`;
|
||||
|
||||
exports[`transformAsset plugin pathname protocol 1`] = `
|
||||
"[asset](pathname:///asset/unchecked.pdf)
|
||||
|
|
|
@ -111,9 +111,9 @@ async function processLinkNode({node, _index, _parent, filePath, staticDir}) {
|
|||
const line =
|
||||
(node.position && node.position.start && node.position.start.line) || '?';
|
||||
throw new Error(
|
||||
`Markdown link url is mandatory. filePath=${toMessageRelativeFilePath(
|
||||
`Markdown link URL is mandatory in "${toMessageRelativeFilePath(
|
||||
filePath,
|
||||
)}, title=${title}, line=${line}`,
|
||||
)}" file (title: ${title}, line: ${line}).`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue