summaryrefslogtreecommitdiff
path: root/packages/integrations/cloudflare/test/with-base-path.js
blob: 904af09c03fb451e0b6e9577b49722b83b1a6e29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// @ts-check
import * as assert from 'node:assert/strict';
import { promises as fs, existsSync } 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/with-base/', import.meta.url);

describe('With base', () => {
	before(async () => {
		await fs.rm(new URL('dist/', root), { recursive: true, force: true });
		await astroCli(fileURLToPath(root), 'build');
	});

	it('generates platform files in the correct directory', async () => {
		for (const file of ['_redirects', '_routes.json', 'blog/static/index.html']) {
			assert.ok(existsSync(new URL(`dist/${file}`, root)));
		}
	});
});