summaryrefslogtreecommitdiff
path: root/test/parallel/test-tls-over-http-tunnel.js
diff options
context:
space:
mode:
authornofwayy <nofwayy@yahoo.fr>2018-10-12 10:25:33 -0700
committerRuben Bridgewater <ruben@bridgewater.de>2018-10-15 12:03:08 +0200
commita24027f9eea200ebf2603560feaf54dfcf50085c (patch)
treeebfc2c3db1e869de722b6e1c7d67280bbdbb578b /test/parallel/test-tls-over-http-tunnel.js
parent244180826e401873ed1b27f8694a24cd81b873a9 (diff)
downloadnode-new-a24027f9eea200ebf2603560feaf54dfcf50085c.tar.gz
test: correct labelling of asserts errors
PR-URL: https://github.com/nodejs/node/pull/23531 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test/parallel/test-tls-over-http-tunnel.js')
-rw-r--r--test/parallel/test-tls-over-http-tunnel.js12
1 files 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 f3f2bb3f27..b26cf7872f 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;
}));