summaryrefslogtreecommitdiff
path: root/packages/integrations/sitemap/test/ssr.test.js
blob: b5c92698b3ba29903e857c545b3ee0de1c6a4633 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { loadFixture, readXML } from './test-utils.js';

describe('SSR support', () => {
	/** @type {import('./test-utils.js').Fixture} */
	let fixture;

	before(async () => {
		fixture = await loadFixture({
			root: './fixtures/ssr/',
		});
		await fixture.build();
	});

	it('SSR pages require zero config', async () => {
		const data = await readXML(fixture.readFile('/client/sitemap-0.xml'));
		const urls = data.urlset.url;

		assert.equal(urls[0].loc[0], 'http://example.com/one/');
		assert.equal(urls[1].loc[0], 'http://example.com/two/');
	});
});