ssr.test.js 648 B

1234567891011121314151617181920212223
  1. import { loadFixture, readXML } from './test-utils.js';
  2. import assert from 'node:assert/strict';
  3. import { before, describe, it } from 'node:test';
  4. describe('SSR support', () => {
  5. /** @type {import('./test-utils.js').Fixture} */
  6. let fixture;
  7. before(async () => {
  8. fixture = await loadFixture({
  9. root: './fixtures/ssr/',
  10. });
  11. await fixture.build();
  12. });
  13. it('SSR pages require zero config', async () => {
  14. const data = await readXML(fixture.readFile('/client/sitemap-0.xml'));
  15. const urls = data.urlset.url;
  16. assert.equal(urls[0].loc[0], 'http://example.com/one/');
  17. assert.equal(urls[1].loc[0], 'http://example.com/two/');
  18. });
  19. });