summaryrefslogtreecommitdiff
path: root/packages/integrations/cloudflare/test/prerender.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/cloudflare/test/prerender.test.js')
-rw-r--r--packages/integrations/cloudflare/test/prerender.test.js26
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: [],
+ });
});
});