diff options
author | 2023-08-10 11:49:52 +0100 | |
---|---|---|
committer | 2023-08-10 11:49:52 +0100 | |
commit | 14b0626f3eca8ec92df29b0d43b87cd2f59efa25 (patch) | |
tree | ffbb2499b12734de79309fb098c964a9ef22428b /packages/integrations/cloudflare/test/prerender.test.js | |
parent | 08c3afb8606f7e0cde30db66c07782c6c058f182 (diff) | |
parent | 1e3c9f515b78dded044a2b1582cf629a15943f69 (diff) | |
download | astro-14b0626f3eca8ec92df29b0d43b87cd2f59efa25.tar.gz astro-14b0626f3eca8ec92df29b0d43b87cd2f59efa25.tar.zst astro-14b0626f3eca8ec92df29b0d43b87cd2f59efa25.zip |
Merge remote-tracking branch 'origin/main' into next
Diffstat (limited to 'packages/integrations/cloudflare/test/prerender.test.js')
-rw-r--r-- | packages/integrations/cloudflare/test/prerender.test.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/packages/integrations/cloudflare/test/prerender.test.js b/packages/integrations/cloudflare/test/prerender.test.js index 847bd950a..fe0721f27 100644 --- a/packages/integrations/cloudflare/test/prerender.test.js +++ b/packages/integrations/cloudflare/test/prerender.test.js @@ -18,13 +18,14 @@ describe('Prerendering', () => { fixture.clean(); }); - it('includes prerendered routes in the routes.json config', async () => { - const foundRoutes = JSON.parse(await fixture.readFile('/_routes.json')).exclude.map((r) => - r.replace(/\\/g, '/') - ); - const expectedExcludedRoutes = ['/_worker.js', '/one/index.html', '/one/']; + it('includes non prerendered routes in the routes.json config', async () => { + const foundRoutes = JSON.parse(await fixture.readFile('/_routes.json')); - expect(foundRoutes.every((element) => expectedExcludedRoutes.includes(element))).to.be.true; + expect(foundRoutes).to.deep.equal({ + version: 1, + include: ['/'], + exclude: [], + }); }); }); @@ -45,12 +46,13 @@ describe('Hybrid rendering', () => { delete process.env.PRERENDER; }); - it('includes prerendered routes in the routes.json config', async () => { - const foundRoutes = JSON.parse(await fixture.readFile('/_routes.json')).exclude.map((r) => - r.replace(/\\/g, '/') - ); - const expectedExcludedRoutes = ['/_worker.js', '/index.html', '/']; + it('includes non prerendered routes in the routes.json config', async () => { + const foundRoutes = JSON.parse(await fixture.readFile('/_routes.json')); - expect(foundRoutes.every((element) => expectedExcludedRoutes.includes(element))).to.be.true; + expect(foundRoutes).to.deep.equal({ + version: 1, + include: ['/one'], + exclude: [], + }); }); }); |