diff options
author | 2023-01-23 09:47:33 -0500 | |
---|---|---|
committer | 2023-01-23 09:47:33 -0500 | |
commit | f5adbd6b55ca13a7523dff2cfc5dccdab9980fa7 (patch) | |
tree | b7955f7140c8ea757687441a5ac307e4db4b884d /packages/integrations/netlify/test/functions/dynamic-route.test.js | |
parent | 9e57268f1318853b612711b31d7461e9b9ce1978 (diff) | |
download | astro-f5adbd6b55ca13a7523dff2cfc5dccdab9980fa7.tar.gz astro-f5adbd6b55ca13a7523dff2cfc5dccdab9980fa7.tar.zst astro-f5adbd6b55ca13a7523dff2cfc5dccdab9980fa7.zip |
Support prerender in Netlify redirects (#5904)
* Support prerender in Netlify redirects
* Updated sorting algorithm
* Update packages/integrations/netlify/src/shared.ts
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Diffstat (limited to 'packages/integrations/netlify/test/functions/dynamic-route.test.js')
-rw-r--r-- | packages/integrations/netlify/test/functions/dynamic-route.test.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/integrations/netlify/test/functions/dynamic-route.test.js b/packages/integrations/netlify/test/functions/dynamic-route.test.js index 0cfb5359b..6bb68eab8 100644 --- a/packages/integrations/netlify/test/functions/dynamic-route.test.js +++ b/packages/integrations/netlify/test/functions/dynamic-route.test.js @@ -21,6 +21,13 @@ describe('Dynamic pages', () => { it('Dynamic pages are included in the redirects file', async () => { const redir = await fixture.readFile('/_redirects'); - expect(redir).to.match(/\/products\/\*/); + expect(redir).to.match(/\/products\/:id/); + }); + + it('Prerendered routes are also included using placeholder syntax', async () => { + const redir = await fixture.readFile('/_redirects'); + 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'); }); }); |