mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
chore(v2): fix async tests (#2906)
This commit is contained in:
parent
66716d1619
commit
08359dd3ca
4 changed files with 24 additions and 28 deletions
|
@ -110,13 +110,13 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`site with wrong sidebar file 1`] = `
|
||||
[Error: Bad sidebars file. The document id 'goku' was used in the sidebar, but no document with this id could be found.
|
||||
"Bad sidebars file. The document id 'goku' was used in the sidebar, but no document with this id could be found.
|
||||
Available document ids=
|
||||
- foo/bar
|
||||
- foo/baz
|
||||
- hello
|
||||
- ipsum
|
||||
- lorem]
|
||||
- lorem"
|
||||
`;
|
||||
|
||||
exports[`versioned website content 1`] = `
|
||||
|
|
|
@ -45,7 +45,7 @@ test('site with wrong sidebar file', async () => {
|
|||
const plugin = pluginContentDocs(context, {
|
||||
sidebarPath,
|
||||
});
|
||||
return plugin.loadContent().catch((e) => expect(e).toMatchSnapshot());
|
||||
await expect(plugin.loadContent()).rejects.toThrowErrorMatchingSnapshot();
|
||||
});
|
||||
|
||||
describe('empty/no docs website', () => {
|
||||
|
|
|
@ -177,16 +177,16 @@ describe('simple site', () => {
|
|||
routeBasePath,
|
||||
};
|
||||
|
||||
return processMetadata({
|
||||
source: 'invalid-id.md',
|
||||
refDir: path.join(badSiteDir, 'docs'),
|
||||
context,
|
||||
options,
|
||||
env,
|
||||
}).catch((e) =>
|
||||
expect(e).toMatchInlineSnapshot(
|
||||
`[Error: Document id cannot include "/".]`,
|
||||
),
|
||||
await expect(
|
||||
processMetadata({
|
||||
source: 'invalid-id.md',
|
||||
refDir: path.join(badSiteDir, 'docs'),
|
||||
context,
|
||||
options,
|
||||
env,
|
||||
}),
|
||||
).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||
`"Document id cannot include \\"/\\"."`,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -196,16 +196,16 @@ describe('simple site', () => {
|
|||
routeBasePath,
|
||||
};
|
||||
|
||||
return processMetadata({
|
||||
source: 'invalid-slug.md',
|
||||
refDir: path.join(badSiteDir, 'docs'),
|
||||
context,
|
||||
options,
|
||||
env,
|
||||
}).catch((e) =>
|
||||
expect(e).toMatchInlineSnapshot(
|
||||
`[Error: Document slug cannot include "/".]`,
|
||||
),
|
||||
await expect(
|
||||
processMetadata({
|
||||
source: 'invalid-slug.md',
|
||||
refDir: path.join(badSiteDir, 'docs'),
|
||||
context,
|
||||
options,
|
||||
env,
|
||||
}),
|
||||
).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||
`"Document slug cannot include \\"/\\"."`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue