diff options
author | 2023-08-17 08:37:38 +0000 | |
---|---|---|
committer | 2023-08-17 08:37:38 +0000 | |
commit | 2145960472565617ad9998dbe189ca6610b70156 (patch) | |
tree | 5af83bb2c1fbcb5aaf0db54fa77e13eb1defac4a /packages/integrations/node | |
parent | dff0f0f8ddd531c5d92a90ac00fdb86d71f77509 (diff) | |
download | astro-2145960472565617ad9998dbe189ca6610b70156.tar.gz astro-2145960472565617ad9998dbe189ca6610b70156.tar.zst astro-2145960472565617ad9998dbe189ca6610b70156.zip |
[ci] format
Diffstat (limited to 'packages/integrations/node')
-rw-r--r-- | packages/integrations/node/test/prerender-404-500.test.js | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/packages/integrations/node/test/prerender-404-500.test.js b/packages/integrations/node/test/prerender-404-500.test.js index 33cebab5b..4e3edff1a 100644 --- a/packages/integrations/node/test/prerender-404-500.test.js +++ b/packages/integrations/node/test/prerender-404-500.test.js @@ -61,18 +61,18 @@ describe('Prerender 404', () => { const res1 = await fetch(url); const res2 = await fetch(url); const res3 = await fetch(url); - + expect(res1.status).to.equal(404); expect(res2.status).to.equal(404); expect(res3.status).to.equal(404); - + const html1 = await res1.text(); const html2 = await res2.text(); const html3 = await res3.text(); expect(html1).to.equal(html2); expect(html2).to.equal(html3); - + const $ = cheerio.load(html1); expect($('body').text()).to.equal('Page does not exist'); @@ -90,7 +90,7 @@ describe('Prerender 404', () => { const html2 = await response2.text(); const html3 = await response3.text(); - expect(html1).to.contain("Something went wrong"); + expect(html1).to.contain('Something went wrong'); expect(html1).to.equal(html2); expect(html2).to.equal(html3); @@ -100,11 +100,10 @@ describe('Prerender 404', () => { const response = await fetch(`http://${server.host}:${server.port}/some-base/fivehundred`); const html = await response.text(); const $ = cheerio.load(html); - + // length will be 0 if the stylesheet does not get included expect($('link[rel=stylesheet]')).to.have.a.lengthOf(1); }); - }); describe('Without base', async () => { @@ -143,22 +142,22 @@ describe('Prerender 404', () => { }); it('Can handle prerendered 404', async () => { - const url = `http://${server.host}:${server.port}/some-base/missing` + const url = `http://${server.host}:${server.port}/some-base/missing`; const res1 = await fetch(url); const res2 = await fetch(url); const res3 = await fetch(url); - + expect(res1.status).to.equal(404); expect(res2.status).to.equal(404); expect(res3.status).to.equal(404); - + const html1 = await res1.text(); const html2 = await res2.text(); const html3 = await res3.text(); expect(html1).to.equal(html2); expect(html2).to.equal(html3); - + const $ = cheerio.load(html1); expect($('body').text()).to.equal('Page does not exist'); @@ -207,22 +206,22 @@ describe('Hybrid 404', () => { }); it('Can handle prerendered 404', async () => { - const url = `http://${server.host}:${server.port}/some-base/missing` + const url = `http://${server.host}:${server.port}/some-base/missing`; const res1 = await fetch(url); const res2 = await fetch(url); const res3 = await fetch(url); - + expect(res1.status).to.equal(404); expect(res2.status).to.equal(404); expect(res3.status).to.equal(404); - + const html1 = await res1.text(); const html2 = await res2.text(); const html3 = await res3.text(); expect(html1).to.equal(html2); expect(html2).to.equal(html3); - + const $ = cheerio.load(html1); expect($('body').text()).to.equal('Page does not exist'); @@ -264,22 +263,22 @@ describe('Hybrid 404', () => { }); it('Can handle prerendered 404', async () => { - const url = `http://${server.host}:${server.port}/missing` + const url = `http://${server.host}:${server.port}/missing`; const res1 = await fetch(url); const res2 = await fetch(url); const res3 = await fetch(url); - + expect(res1.status).to.equal(404); expect(res2.status).to.equal(404); expect(res3.status).to.equal(404); - + const html1 = await res1.text(); const html2 = await res2.text(); const html3 = await res3.text(); expect(html1).to.equal(html2); expect(html2).to.equal(html3); - + const $ = cheerio.load(html1); expect($('body').text()).to.equal('Page does not exist'); |