diff options
author | 2023-06-05 13:05:47 +0000 | |
---|---|---|
committer | 2023-06-05 13:05:47 +0000 | |
commit | eb459577f017e2ac4f67a4c61c2e86517ce10938 (patch) | |
tree | ee6f876ec297d1c8b962c96200ce6b88918c29be /packages/integrations/netlify/test | |
parent | 57f8d14c027c30919363e12c664ccff4ed64d0fc (diff) | |
download | astro-eb459577f017e2ac4f67a4c61c2e86517ce10938.tar.gz astro-eb459577f017e2ac4f67a4c61c2e86517ce10938.tar.zst astro-eb459577f017e2ac4f67a4c61c2e86517ce10938.zip |
[ci] format
Diffstat (limited to 'packages/integrations/netlify/test')
-rw-r--r-- | packages/integrations/netlify/test/functions/redirects.test.js | 18 | ||||
-rw-r--r-- | packages/integrations/netlify/test/static/redirects.test.js | 26 |
2 files changed, 31 insertions, 13 deletions
diff --git a/packages/integrations/netlify/test/functions/redirects.test.js b/packages/integrations/netlify/test/functions/redirects.test.js index 8a6d36694..767e5b13b 100644 --- a/packages/integrations/netlify/test/functions/redirects.test.js +++ b/packages/integrations/netlify/test/functions/redirects.test.js @@ -18,7 +18,7 @@ describe('SSG - Redirects', () => { site: `http://example.com`, integrations: [testIntegration()], redirects: { - '/other': '/' + '/other': '/', }, experimental: { redirects: true, @@ -31,14 +31,22 @@ describe('SSG - Redirects', () => { let redirects = await fixture.readFile('/_redirects'); let parts = redirects.split(/\s+/); expect(parts).to.deep.equal([ - '/other', '/', '301', + '/other', + '/', + '301', // This uses the dynamic Astro.redirect, so we don't know that it's a redirect // until runtime. This is correct! - '/nope', '/.netlify/functions/entry', '200', - '/', '/.netlify/functions/entry', '200', + '/nope', + '/.netlify/functions/entry', + '200', + '/', + '/.netlify/functions/entry', + '200', // A real route - '/team/articles/*', '/.netlify/functions/entry', '200', + '/team/articles/*', + '/.netlify/functions/entry', + '200', ]); }); }); diff --git a/packages/integrations/netlify/test/static/redirects.test.js b/packages/integrations/netlify/test/static/redirects.test.js index 0b153b31c..d2f87d4f6 100644 --- a/packages/integrations/netlify/test/static/redirects.test.js +++ b/packages/integrations/netlify/test/static/redirects.test.js @@ -20,10 +20,10 @@ describe('SSG - Redirects', () => { '/other': '/', '/two': { status: 302, - destination: '/' + destination: '/', }, - '/blog/[...slug]': '/team/articles/[...slug]' - } + '/blog/[...slug]': '/team/articles/[...slug]', + }, }); await fixture.build(); }); @@ -32,12 +32,22 @@ describe('SSG - Redirects', () => { let redirects = await fixture.readFile('/_redirects'); let parts = redirects.split(/\s+/); expect(parts).to.deep.equal([ - '/two', '/', '302', - '/other', '/', '301', - '/nope', '/', '301', + '/two', + '/', + '302', + '/other', + '/', + '301', + '/nope', + '/', + '301', - '/blog/*', '/team/articles/*/index.html', '301', - '/team/articles/*', '/team/articles/*/index.html', '200', + '/blog/*', + '/team/articles/*/index.html', + '301', + '/team/articles/*', + '/team/articles/*/index.html', + '200', ]); }); }); |