mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-30 00:17:58 +02:00
test: fix async tests resolved in random order (#6143)
This commit is contained in:
parent
9078fd9fb2
commit
287292497d
2 changed files with 9 additions and 31 deletions
|
@ -468,7 +468,7 @@ describe('simple site', () => {
|
||||||
|
|
||||||
test('docs with invalid id', async () => {
|
test('docs with invalid id', async () => {
|
||||||
const {defaultTestUtils} = await loadSite();
|
const {defaultTestUtils} = await loadSite();
|
||||||
expect(() => {
|
await expect(async () =>
|
||||||
defaultTestUtils.processDocFile(
|
defaultTestUtils.processDocFile(
|
||||||
createFakeDocFile({
|
createFakeDocFile({
|
||||||
source: 'some/fake/path',
|
source: 'some/fake/path',
|
||||||
|
@ -476,8 +476,8 @@ describe('simple site', () => {
|
||||||
id: 'Hello/world',
|
id: 'Hello/world',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
);
|
),
|
||||||
}).toThrowErrorMatchingInlineSnapshot(
|
).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||||
`"Document id \\"Hello/world\\" cannot include slash."`,
|
`"Document id \\"Hello/world\\" cannot include slash."`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -485,7 +485,9 @@ describe('simple site', () => {
|
||||||
test('custom pagination', async () => {
|
test('custom pagination', async () => {
|
||||||
const {defaultTestUtils, options, versionsMetadata} = await loadSite();
|
const {defaultTestUtils, options, versionsMetadata} = await loadSite();
|
||||||
const docs = await readVersionDocs(versionsMetadata[0], options);
|
const docs = await readVersionDocs(versionsMetadata[0], options);
|
||||||
expect(await defaultTestUtils.generateNavigation(docs)).toMatchSnapshot();
|
await expect(
|
||||||
|
defaultTestUtils.generateNavigation(docs),
|
||||||
|
).resolves.toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('bad pagination', async () => {
|
test('bad pagination', async () => {
|
||||||
|
@ -497,9 +499,9 @@ describe('simple site', () => {
|
||||||
frontmatter: {pagination_prev: 'nonexistent'},
|
frontmatter: {pagination_prev: 'nonexistent'},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
await expect(async () => {
|
await expect(
|
||||||
await defaultTestUtils.generateNavigation(docs);
|
defaultTestUtils.generateNavigation(docs),
|
||||||
}).rejects.toThrowErrorMatchingInlineSnapshot(
|
).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||||
`"Error when loading hehe in .: the pagination_prev front matter points to a non-existent ID nonexistent."`,
|
`"Error when loading hehe in .: the pagination_prev front matter points to a non-existent ID nonexistent."`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -247,27 +247,3 @@ These lifecycle methods are not essential but recommended:
|
||||||
|
|
||||||
- [`validateThemeConfig({themeConfig, validate})`](./api/plugin-methods/static-methods.md#validateThemeConfig)
|
- [`validateThemeConfig({themeConfig, validate})`](./api/plugin-methods/static-methods.md#validateThemeConfig)
|
||||||
- [`validateOptions({options, validate})`](./api/plugin-methods/static-methods.md#validateOptions)
|
- [`validateOptions({options, validate})`](./api/plugin-methods/static-methods.md#validateOptions)
|
||||||
|
|
||||||
<!--
|
|
||||||
|
|
||||||
Outline
|
|
||||||
---
|
|
||||||
High-level overview about themes:
|
|
||||||
- how to use a theme
|
|
||||||
- how to pass theme configurations
|
|
||||||
- how to swizzle components and the power of it
|
|
||||||
|
|
||||||
Related pieces
|
|
||||||
---
|
|
||||||
|
|
||||||
- [Advanced Guides – Themes](using-themes.md)
|
|
||||||
- [Lifecycle APIs](./api/lifecycle-apis.md)
|
|
||||||
|
|
||||||
References
|
|
||||||
---
|
|
||||||
- [themes RFC](https://github.com/facebook/docusaurus/issues/1438)
|
|
||||||
- [how classic template uses themes](/packages/docusaurus/templates/classic/docusaurus.config.js)
|
|
||||||
- [using plugins doc](using-plugins.md)
|
|
||||||
- [vuepress docs on themes](https://v1.vuepress.vuejs.org/theme/)
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue