mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-26 21:18:47 +02:00
feat(v2): presets (#1401)
* feat(v2): presets * misc: add newline * misc: add tests * misc: fix path
This commit is contained in:
parent
7ebcf10478
commit
361986515c
28 changed files with 394 additions and 89 deletions
|
@ -13,9 +13,9 @@ describe('docusaurus-plugin-sitemap', () => {
|
|||
test.each(['simple', 'versioned', 'translated', 'transversioned'])(
|
||||
'%s website',
|
||||
async type => {
|
||||
const props = await loadSetup(type);
|
||||
const plugin = new DocusaurusPluginSitemap(null, props);
|
||||
const sitemap = await plugin.createSitemap(props);
|
||||
const context = await loadSetup(type);
|
||||
const plugin = new DocusaurusPluginSitemap(context, null);
|
||||
const sitemap = await plugin.createSitemap(context);
|
||||
expect(sitemap).toContain(
|
||||
`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">`,
|
||||
);
|
||||
|
@ -23,10 +23,10 @@ describe('docusaurus-plugin-sitemap', () => {
|
|||
);
|
||||
|
||||
test('empty site', async () => {
|
||||
const props = await loadSetup('empty');
|
||||
const plugin = new DocusaurusPluginSitemap(null, props);
|
||||
const context = await loadSetup('empty');
|
||||
const plugin = new DocusaurusPluginSitemap(context, null);
|
||||
expect(
|
||||
plugin.createSitemap(props),
|
||||
plugin.createSitemap(context),
|
||||
).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||
`"Url in docusaurus.config.js cannot be empty/undefined"`,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue