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

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

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

	it('does not have wrong chunks', async () => {
		const content = await fixture.readFile('_worker.js/renderers.mjs');
		const hasImportFromPrerender = !content.includes(`React } from './chunks/prerender`);
		assert.ok(hasImportFromPrerender);
	});
});