diff options
author | 2024-02-01 21:24:21 +0000 | |
---|---|---|
committer | 2024-02-01 16:24:21 -0500 | |
commit | 4d23caed76081742ddffe99841f5a1cb672f8d99 (patch) | |
tree | 92fdc68ef001f2d86c977cbf760c5bb6c06c2a2d /packages/integrations/node/test/prerender.test.js | |
parent | 879c712c0327d4603b17339218014077244c0f5f (diff) | |
download | astro-4d23caed76081742ddffe99841f5a1cb672f8d99.tar.gz astro-4d23caed76081742ddffe99841f5a1cb672f8d99.tar.zst astro-4d23caed76081742ddffe99841f5a1cb672f8d99.zip |
fix(NodeApp): fix responses with null bodies never completing (#9931)
* fix(NodeApp): fix responses with null bodies never completing
* add changeset
* add test
* chore(tests): restore correct assertions
* adjust incorrect test
* added Astro.redirect and Response.redirect test cases
* updated incorrect HTTP status
* adjust api-routes.test.js after cherry-pick
* bup markdoc test timeout
---------
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Friedemann Sommer <friedemannsommer@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/node/test/prerender.test.js')
-rw-r--r-- | packages/integrations/node/test/prerender.test.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/integrations/node/test/prerender.test.js b/packages/integrations/node/test/prerender.test.js index 597794be0..7036c913c 100644 --- a/packages/integrations/node/test/prerender.test.js +++ b/packages/integrations/node/test/prerender.test.js @@ -82,8 +82,7 @@ describe('Prerendering', () => { }); const html = await res.text(); const $ = cheerio.load(html); - assert.equal(res.status, 301); - assert.equal(res.headers.get('location'), '/some-base/two/'); + assert.equal(res.status, 200); assert.equal($('h1').text(), 'Two'); }); }); @@ -171,8 +170,8 @@ describe('Prerendering', () => { const html = await res.text(); const $ = cheerio.load(html); - expect(res.status).to.equal(200); - expect($('h1').text()).to.equal('One'); + assert.equal(res.status, 200); + assert.equal($('h1').text(), 'One'); }); it('Can render prerendered route', async () => { @@ -180,8 +179,8 @@ describe('Prerendering', () => { const html = await res.text(); const $ = cheerio.load(html); - expect(res.status).to.equal(200); - expect($('h1').text()).to.equal('Two'); + assert.equal(res.status, 200); + assert.equal($('h1').text(), 'Two'); }); }); }); @@ -252,8 +251,9 @@ describe('Hybrid rendering', () => { const res = await fetch(`http://${server.host}:${server.port}/some-base/one`, { redirect: 'manual', }); - assert.equal(res.status, 301); - assert.equal(res.headers.get('location'), '/some-base/one/'); + const html = await res.text(); + const $ = cheerio.load(html); + assert.equal(res.status, 200); assert.equal($('h1').text(), 'One'); }); }); @@ -342,8 +342,8 @@ describe('Hybrid rendering', () => { const html = await res.text(); const $ = cheerio.load(html); - expect(res.status).to.equal(200); - expect($('h1').text()).to.equal('shared'); + assert.equal(res.status, 200); + assert.equal($('h1').text(), 'shared'); }); }); }); |