summaryrefslogtreecommitdiff
path: root/packages/integrations/cloudflare/test/prerender.test.js
blob: c0fab6efcf9348695e58d867afb5d50ce16ddcc0 (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 * as assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { before, describe, it } from 'node:test';
import { fileURLToPath } from 'node:url';
import { astroCli } from './_test-utils.js';

const root = new URL('./fixtures/prerender/', import.meta.url);

describe('Prerendering', () => {
	before(async () => {
		await astroCli(fileURLToPath(root), 'build');
	});

	it('includes non prerendered routes in the routes.json config', async () => {
		const foundRoutes = JSON.parse(readFileSync(fileURLToPath(new URL('dist/_routes.json', root))));

		assert.deepEqual(foundRoutes, {
			version: 1,
			include: ['/', '/_image'],
			exclude: [],
		});
	});
});