From da1f7d7e45be17d3dfb02ec84fdb0e20c101f9f3 Mon Sep 17 00:00:00 2001 From: Gil Pedersen Date: Wed, 15 Nov 2023 11:11:53 +0100 Subject: [PATCH] Fix node 20 failing test cases --- test/request.js | 10 +++++----- test/route.js | 2 +- test/transmit.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/request.js b/test/request.js index 748c68d16..62cf6309c 100755 --- a/test/request.js +++ b/test/request.js @@ -585,8 +585,8 @@ describe('Request', () => { const client = Net.connect(server.info.port, () => { - client.write('GET / HTTP/1.1\r\n\r\n'); - client.write('GET / HTTP/1.1\r\n\r\n'); + client.write('GET / HTTP/1.1\r\nHost: host\r\n\r\n'); + client.write('GET / HTTP/1.1\r\nHost: host\r\n\r\n'); }); client.on('data', () => { @@ -662,9 +662,9 @@ describe('Request', () => { const client = Net.connect(server.info.port, () => { - client.write('GET /test HTTP/1.1\r\n\r\n'); - client.write('GET /test HTTP/1.1\r\n\r\n'); - client.write('GET /test HTTP/1.1\r\n\r\n'); + client.write('GET /test HTTP/1.1\r\nHost: host\r\n\r\n'); + client.write('GET /test HTTP/1.1\r\nHost: host\r\n\r\n'); + client.write('GET /test HTTP/1.1\r\nHost: host\r\n\r\n'); }); await team.work; diff --git a/test/route.js b/test/route.js index f47b09dbd..e8dae012b 100755 --- a/test/route.js +++ b/test/route.js @@ -223,7 +223,7 @@ describe('Route', () => { expect(res.statusCode).to.equal(200); expect(logged).to.be.an.object(); expect(logged.error).to.be.an.error('Invalid request payload JSON format'); - expect(logged.error.data).to.be.an.error(SyntaxError, /^Unexpected token a/); + expect(logged.error.data).to.be.an.error(SyntaxError, /at position 1/); }); it('returns payload parsing errors', async () => { diff --git a/test/transmit.js b/test/transmit.js index 4ce1e23e0..523bd24a7 100755 --- a/test/transmit.js +++ b/test/transmit.js @@ -428,7 +428,7 @@ describe('transmission', () => { const log = server.events.once('response'); const client = Net.connect(server.info.port, () => { - client.write('GET / HTTP/1.1\r\naccept-encoding: gzip\r\n\r\n'); + client.write('GET / HTTP/1.1\r\nHost: host\r\naccept-encoding: gzip\r\n\r\n'); }); const [request] = await log;