diff options
author | 2024-02-26 21:28:49 +0800 | |
---|---|---|
committer | 2024-02-26 18:58:49 +0530 | |
commit | ae2a10e1a768e31d243194694222932ffafb54cc (patch) | |
tree | 93227e002b604f6fe580559092aa3115d7a4c7ba /packages/integrations/vercel/test/split.test.js | |
parent | bc2bf460eae13cbdad851afd4bda2602babca30b (diff) | |
download | astro-ae2a10e1a768e31d243194694222932ffafb54cc.tar.gz astro-ae2a10e1a768e31d243194694222932ffafb54cc.tar.zst astro-ae2a10e1a768e31d243194694222932ffafb54cc.zip |
Fix an issue where Vercel adapter may create functions for prerendered routes (#10231)
* fix: fix an issue where Vercel adapter may create functions for prerendered routes
* test: update test cases in `split.test.js`
* chore: add changeset
* refactor: apply suggested changes from code review
* Apply suggestions from code review
---------
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/vercel/test/split.test.js')
-rw-r--r-- | packages/integrations/vercel/test/split.test.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/integrations/vercel/test/split.test.js b/packages/integrations/vercel/test/split.test.js index fbd61aa9b..e64a4dc60 100644 --- a/packages/integrations/vercel/test/split.test.js +++ b/packages/integrations/vercel/test/split.test.js @@ -14,14 +14,19 @@ describe('build: split', () => { await fixture.build(); }); - it('creates separate functions for each page', async () => { + it('creates separate functions for non-prerendered pages', async () => { const files = await fixture.readdir('../.vercel/output/functions/'); assert.equal(files.length, 3); + assert.equal(files.includes('prerender.astro.func'), false); }); it('creates the route definitions in the config.json', async () => { const json = await fixture.readFile('../.vercel/output/config.json'); const config = JSON.parse(json); assert.equal(config.routes.length, 5); + assert.equal( + config.routes.some((route) => route.dest === 'prerender.astro'), + false + ); }); }); |