summaryrefslogtreecommitdiff
path: root/packages/integrations/vercel/test/serverless-with-dynamic-routes.test.js
diff options
context:
space:
mode:
authorGravatar Slawek Kolodziej <hfrntt@gmail.com> 2023-09-06 06:43:53 +0200
committerGravatar GitHub <noreply@github.com> 2023-09-06 05:43:53 +0100
commit9ffa1a84e81f52d55ffe07826b8b1f10fc023ee9 (patch)
tree00c13135d268e4705357a69b9949ae3d9c2340ed /packages/integrations/vercel/test/serverless-with-dynamic-routes.test.js
parent61ad70fdc52035964c43ecdb4cf7468f6c2b61e7 (diff)
downloadastro-9ffa1a84e81f52d55ffe07826b8b1f10fc023ee9.tar.gz
astro-9ffa1a84e81f52d55ffe07826b8b1f10fc023ee9.tar.zst
astro-9ffa1a84e81f52d55ffe07826b8b1f10fc023ee9.zip
fix: include route prefix in vercel func names, fix #8401 (#8408)
* fix: include route prefix in vercel func names * chore: add changeset * chore: update pnpm lockfile * refactor: simplify logic that generates vercel func names * fix: properly remove entryFile prefix from func name * refactor: change how vercel function names are generated --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/vercel/test/serverless-with-dynamic-routes.test.js')
-rw-r--r--packages/integrations/vercel/test/serverless-with-dynamic-routes.test.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/integrations/vercel/test/serverless-with-dynamic-routes.test.js b/packages/integrations/vercel/test/serverless-with-dynamic-routes.test.js
new file mode 100644
index 000000000..325f9c5b0
--- /dev/null
+++ b/packages/integrations/vercel/test/serverless-with-dynamic-routes.test.js
@@ -0,0 +1,22 @@
+import { expect } from 'chai';
+import { loadFixture } from './test-utils.js';
+
+describe('Serverless with dynamic routes', () => {
+ /** @type {import('./test-utils.js').Fixture} */
+ let fixture;
+
+ before(async () => {
+ process.env.PRERENDER = true;
+ fixture = await loadFixture({
+ root: './fixtures/serverless-with-dynamic-routes/',
+ output: 'hybrid',
+ });
+ await fixture.build();
+ });
+
+ it('build successful', async () => {
+ expect(await fixture.readFile('../.vercel/output/static/index.html')).to.be.ok;
+ expect(await fixture.readFile('../.vercel/output/functions/[id]/index.astro.func/.vc-config.json')).to.be.ok;
+ expect(await fixture.readFile('../.vercel/output/functions/api/[id].js.func/.vc-config.json')).to.be.ok;
+ });
+});