summaryrefslogtreecommitdiff
path: root/packages/integrations/cloudflare/test/no-output.test.js
blob: bf5321491a52035ed35c6c64c00d6d392df31cdb (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 { describe, it } from 'node:test';
import { fileURLToPath } from 'node:url';
import { astroCli } from './_test-utils.js';

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

describe('MissingOutputConfig', () => {
	it('throws during the build', async () => {
		let error = undefined;
		try {
			await astroCli(fileURLToPath(root), 'build');
		} catch (err) {
			error = err;
		}
		assert.notEqual(error, undefined);
		assert.ok(
			error.message.includes(
				'[@astrojs/cloudflare] `output: "server"` or `output: "hybrid"` is required to use this adapter.'
			)
		);
	});
});