From 5dd4c2098ea9d474dc6fa820e676cdea1734d05f Mon Sep 17 00:00:00 2001 From: nofwayy Date: Fri, 12 Oct 2018 10:25:33 -0700 Subject: [PATCH] test: correct labelling of asserts errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/23531 Reviewed-By: Сковорода Никита Андреевич Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater --- test/parallel/test-tls-over-http-tunnel.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-tls-over-http-tunnel.js b/test/parallel/test-tls-over-http-tunnel.js index f3f2bb3f2726ed..b26cf7872f6582 100644 --- a/test/parallel/test-tls-over-http-tunnel.js +++ b/test/parallel/test-tls-over-http-tunnel.js @@ -57,12 +57,12 @@ const proxy = net.createServer((clientSocket) => { clientSocket.on('data', (chunk) => { if (!serverSocket) { // Verify the CONNECT request - assert.strictEqual(`CONNECT localhost:${server.address().port} ` + + assert.strictEqual(chunk.toString(), + `CONNECT localhost:${server.address().port} ` + 'HTTP/1.1\r\n' + 'Proxy-Connections: keep-alive\r\n' + `Host: localhost:${proxy.address().port}\r\n` + - 'Connection: close\r\n\r\n', - chunk.toString()); + 'Connection: close\r\n\r\n'); console.log('PROXY: got CONNECT request'); console.log('PROXY: creating a tunnel'); @@ -126,7 +126,7 @@ proxy.listen(0, common.mustCall(() => { } function onConnect(res, socket, header) { - assert.strictEqual(200, res.statusCode); + assert.strictEqual(res.statusCode, 200); console.log('CLIENT: got CONNECT response'); // detach the socket @@ -149,10 +149,10 @@ proxy.listen(0, common.mustCall(() => { agent: false, rejectUnauthorized: false }, (res) => { - assert.strictEqual(200, res.statusCode); + assert.strictEqual(res.statusCode, 200); res.on('data', common.mustCall((chunk) => { - assert.strictEqual('hello world\n', chunk.toString()); + assert.strictEqual(chunk.toString(), 'hello world\n'); console.log('CLIENT: got HTTPS response'); gotRequest = true; }));