diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts b/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts index a4a78f6b15..5237c4fffa 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts @@ -468,7 +468,7 @@ describe('simple site', () => { test('docs with invalid id', async () => { const {defaultTestUtils} = await loadSite(); - expect(() => { + await expect(async () => defaultTestUtils.processDocFile( createFakeDocFile({ source: 'some/fake/path', @@ -476,8 +476,8 @@ describe('simple site', () => { id: 'Hello/world', }, }), - ); - }).toThrowErrorMatchingInlineSnapshot( + ), + ).rejects.toThrowErrorMatchingInlineSnapshot( `"Document id \\"Hello/world\\" cannot include slash."`, ); }); @@ -485,7 +485,9 @@ describe('simple site', () => { test('custom pagination', async () => { const {defaultTestUtils, options, versionsMetadata} = await loadSite(); const docs = await readVersionDocs(versionsMetadata[0], options); - expect(await defaultTestUtils.generateNavigation(docs)).toMatchSnapshot(); + await expect( + defaultTestUtils.generateNavigation(docs), + ).resolves.toMatchSnapshot(); }); test('bad pagination', async () => { @@ -497,9 +499,9 @@ describe('simple site', () => { frontmatter: {pagination_prev: 'nonexistent'}, }), ); - await expect(async () => { - await defaultTestUtils.generateNavigation(docs); - }).rejects.toThrowErrorMatchingInlineSnapshot( + await expect( + defaultTestUtils.generateNavigation(docs), + ).rejects.toThrowErrorMatchingInlineSnapshot( `"Error when loading hehe in .: the pagination_prev front matter points to a non-existent ID nonexistent."`, ); }); diff --git a/website/docs/using-themes.md b/website/docs/using-themes.md index 92e2586067..c2be7d8f41 100644 --- a/website/docs/using-themes.md +++ b/website/docs/using-themes.md @@ -247,27 +247,3 @@ These lifecycle methods are not essential but recommended: - [`validateThemeConfig({themeConfig, validate})`](./api/plugin-methods/static-methods.md#validateThemeConfig) - [`validateOptions({options, validate})`](./api/plugin-methods/static-methods.md#validateOptions) - -