/** * 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/lib/server/load/__tests__/loadSetup'; import DocusaurusPluginSitemap from '../index'; describe('docusaurus-plugin-sitemap', () => { describe('createSitemap', () => { test.each(['simple'])('%s website', async type => { const context = await loadSetup(type); const plugin = new DocusaurusPluginSitemap(context, null); const sitemap = await plugin.createSitemap(context); expect(sitemap).toContain( ``, ); }); test('empty site', async () => { const context = await loadSetup('empty'); const plugin = new DocusaurusPluginSitemap(context, null); expect( plugin.createSitemap(context), ).rejects.toThrowErrorMatchingInlineSnapshot( `"Url in docusaurus.config.js cannot be empty/undefined"`, ); }); }); });