blob: 00d6ccde305b630f0ed0ed97d764f35f56bc1ca4 (
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
24
25
26
27
|
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { loadFixture, readXML } from './test-utils.js';
describe('routes', () => {
/** @type {import('./test-utils.js').Fixture} */
let fixture;
/** @type {string[]} */
let urls;
before(async () => {
fixture = await loadFixture({
root: './fixtures/static/',
});
await fixture.build();
const data = await readXML(fixture.readFile('/sitemap-0.xml'));
urls = data.urlset.url.map((url) => url.loc[0]);
});
it('does not include endpoints', async () => {
assert.equal(urls.includes('http://example.com/endpoint.json'), false);
});
it('does not include redirects', async () => {
assert.equal(urls.includes('http://example.com/redirect'), false);
});
});
|