/** * Copyright (c) 2017-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import loadSetup from '../../docusaurus/test/loadSetup'; import DocusaurusPluginSitemap from '../index'; describe('docusaurus-plugin-sitemap', () => { describe('createSitemap', () => { 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); expect(sitemap).toContain( ``, ); }, ); test('empty site', async () => { const props = await loadSetup('empty'); const plugin = new DocusaurusPluginSitemap(null, props); expect( plugin.createSitemap(props), ).rejects.toThrowErrorMatchingInlineSnapshot( `"Url in docusaurus.config.js cannot be empty/undefined"`, ); }); }); });