summaryrefslogtreecommitdiff
path: root/packages/astro/test/dynamic-route-build-file.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro/test/dynamic-route-build-file.test.js')
-rw-r--r--packages/astro/test/dynamic-route-build-file.test.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/astro/test/dynamic-route-build-file.test.js b/packages/astro/test/dynamic-route-build-file.test.js
new file mode 100644
index 000000000..12787dd3a
--- /dev/null
+++ b/packages/astro/test/dynamic-route-build-file.test.js
@@ -0,0 +1,25 @@
+import assert from 'node:assert/strict';
+import { before, describe, it } from 'node:test';
+import * as cheerio from 'cheerio';
+import { loadFixture } from './test-utils.js';
+
+describe('build.format=file with dynamic routes', () => {
+ /** @type {import('./test-utils').Fixture} */
+ let fixture;
+
+ before(async () => {
+ fixture = await loadFixture({
+ root: './fixtures/dynamic-route-build-file',
+ build: {
+ format: 'file',
+ },
+ });
+ await fixture.build();
+ });
+
+ it('Outputs a slug of undefined as the index.html', async () => {
+ const html = await fixture.readFile('/index.html');
+ const $ = cheerio.load(html);
+ assert.equal($('h1').text(), 'Astro Store');
+ });
+});