summaryrefslogtreecommitdiff
path: root/packages/integrations/cloudflare/test/prerender.test.js
blob: 8ba43f9e5f32937b9d01a699209b0c2738b894e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { readFileSync } from 'fs';
import { astroCli } from './_test-utils.js';
import { expect } from 'chai';
import { fileURLToPath } from 'url';

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))));

		expect(foundRoutes).to.deep.equal({
			version: 1,
			include: ['/', '/_image'],
			exclude: [],
		});
	});
});