summaryrefslogtreecommitdiff
path: root/packages/integrations/netlify/test/functions/dynamic-route.test.js
diff options
context:
space:
mode:
authorGravatar alexanderniebuhr <alexanderniebuhr@users.noreply.github.com> 2023-10-16 14:10:41 +0000
committerGravatar astrobot-houston <fred+astrobot@astro.build> 2023-10-16 14:10:41 +0000
commit3d1329414e507345b19e1dee81fe1bbff4eb3ae0 (patch)
tree69c822b1dc12f177b4919337109e6300a04df91d /packages/integrations/netlify/test/functions/dynamic-route.test.js
parent63977f5e438062b7e9302b8feff41b662bfa6231 (diff)
downloadastro-3d1329414e507345b19e1dee81fe1bbff4eb3ae0.tar.gz
astro-3d1329414e507345b19e1dee81fe1bbff4eb3ae0.tar.zst
astro-3d1329414e507345b19e1dee81fe1bbff4eb3ae0.zip
[ci] format
Diffstat (limited to 'packages/integrations/netlify/test/functions/dynamic-route.test.js')
-rw-r--r--packages/integrations/netlify/test/functions/dynamic-route.test.js50
1 files changed, 31 insertions, 19 deletions
diff --git a/packages/integrations/netlify/test/functions/dynamic-route.test.js b/packages/integrations/netlify/test/functions/dynamic-route.test.js
index 2e20454e6..69d25a11e 100644
--- a/packages/integrations/netlify/test/functions/dynamic-route.test.js
+++ b/packages/integrations/netlify/test/functions/dynamic-route.test.js
@@ -1,24 +1,36 @@
-import { expect } from 'chai';
-import { cli } from './test-utils.js';
-import { fileURLToPath } from 'url';
-import fs from 'fs/promises';
+import { expect } from "chai";
+import { cli } from "./test-utils.js";
+import { fileURLToPath } from "url";
+import fs from "fs/promises";
-const root = new URL('./fixtures/dynamic-route/', import.meta.url).toString();
+const root = new URL("./fixtures/dynamic-route/", import.meta.url).toString();
-describe('Dynamic pages', () => {
- before(async () => {
- await cli('build', '--root', fileURLToPath(root));
- });
+describe("Dynamic pages", () => {
+ before(async () => {
+ await cli("build", "--root", fileURLToPath(root));
+ });
- it('Dynamic pages are included in the redirects file', async () => {
- const redir = await fs.readFile(new URL('./dist/_redirects', root), 'utf-8');
- expect(redir).to.match(/\/products\/:id/);
- });
+ it("Dynamic pages are included in the redirects file", async () => {
+ const redir = await fs.readFile(
+ new URL("./dist/_redirects", root),
+ "utf-8",
+ );
+ expect(redir).to.match(/\/products\/:id/);
+ });
- it('Prerendered routes are also included using placeholder syntax', async () => {
- const redir = await fs.readFile(new URL('./dist/_redirects', root), 'utf-8');
- expect(redir).to.include('/pets/:cat /pets/:cat/index.html 200');
- expect(redir).to.include('/pets/:dog /pets/:dog/index.html 200');
- expect(redir).to.include('/pets /.netlify/functions/entry 200');
- });
+ it("Prerendered routes are also included using placeholder syntax", async () => {
+ const redir = await fs.readFile(
+ new URL("./dist/_redirects", root),
+ "utf-8",
+ );
+ expect(redir).to.include(
+ "/pets/:cat /pets/:cat/index.html 200",
+ );
+ expect(redir).to.include(
+ "/pets/:dog /pets/:dog/index.html 200",
+ );
+ expect(redir).to.include(
+ "/pets /.netlify/functions/entry 200",
+ );
+ });
});