summaryrefslogtreecommitdiff
path: root/packages/integrations/sitemap/test/staticPaths.test.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--packages/integrations/sitemap/test/staticPaths.test.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/packages/integrations/sitemap/test/staticPaths.test.js b/packages/integrations/sitemap/test/staticPaths.test.js
index bb818e7cd..6fddbb193 100644
--- a/packages/integrations/sitemap/test/staticPaths.test.js
+++ b/packages/integrations/sitemap/test/staticPaths.test.js
@@ -4,19 +4,29 @@ import { expect } from 'chai';
describe('getStaticPaths support', () => {
/** @type {import('./test-utils.js').Fixture} */
let fixture;
+ /** @type {string[]} */
+ let urls;
before(async () => {
fixture = await loadFixture({
root: './fixtures/static/',
});
await fixture.build();
- });
- it('getStaticPath pages require zero config', async () => {
const data = await readXML(fixture.readFile('/sitemap-0.xml'));
- const urls = data.urlset.url;
+ urls = data.urlset.url.map(url => url.loc[0]);
+ });
- expect(urls[0].loc[0]).to.equal('http://example.com/one/');
- expect(urls[1].loc[0]).to.equal('http://example.com/two/');
+ it('requires zero config for getStaticPaths', async () => {
+ expect(urls).to.include('http://example.com/one/');
+ expect(urls).to.include('http://example.com/two/');
});
+
+ it('does not include 404 pages', () => {
+ expect(urls).to.not.include('http://example.com/404/');
+ });
+
+ it('includes numerical pages', () => {
+ expect(urls).to.include('http://example.com/123/');
+ })
});