summaryrefslogtreecommitdiff
path: root/packages/integrations/netlify/test/functions/dynamic-route.test.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2022-04-19 11:22:15 -0400
committerGravatar GitHub <noreply@github.com> 2022-04-19 11:22:15 -0400
commitee3577933703799580d463755aab2951d20e2f82 (patch)
treec80148832d2d6724dcec9f957b0c660328bae034 /packages/integrations/netlify/test/functions/dynamic-route.test.js
parentf21d97fb4cba5bb82b4de9c07633823e12b15931 (diff)
downloadastro-ee3577933703799580d463755aab2951d20e2f82.tar.gz
astro-ee3577933703799580d463755aab2951d20e2f82.tar.zst
astro-ee3577933703799580d463755aab2951d20e2f82.zip
Netlify Edge function support (#3148)
* Netlify Edge function support * Update readme with edge function information * Adds a changeset * Disable running edge function test in CI for now
Diffstat (limited to 'packages/integrations/netlify/test/functions/dynamic-route.test.js')
-rw-r--r--packages/integrations/netlify/test/functions/dynamic-route.test.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/integrations/netlify/test/functions/dynamic-route.test.js b/packages/integrations/netlify/test/functions/dynamic-route.test.js
new file mode 100644
index 000000000..279982767
--- /dev/null
+++ b/packages/integrations/netlify/test/functions/dynamic-route.test.js
@@ -0,0 +1,28 @@
+import { expect } from 'chai';
+import netlifyAdapter from '../../dist/index.js';
+import { loadFixture, testIntegration } from './test-utils.js';
+
+describe('Dynamic pages', () => {
+ /** @type {import('./test-utils').Fixture} */
+ let fixture;
+
+ before(async () => {
+ fixture = await loadFixture({
+ root: new URL('./fixtures/dynamic-route/', import.meta.url).toString(),
+ experimental: {
+ ssr: true,
+ },
+ adapter: netlifyAdapter({
+ dist: new URL('./fixtures/dynamic-route/dist/', import.meta.url),
+ }),
+ site: `http://example.com`,
+ integrations: [ testIntegration() ]
+ });
+ await fixture.build();
+ });
+
+ it('Dynamic pages are included in the redirects file', async () => {
+ const redir = await fixture.readFile('/_redirects');
+ expect(redir).to.match(/\/products\/\*/);
+ });
+});