From 55de6ff38dfc639d82a1acbd9016fd4ebe67240f Mon Sep 17 00:00:00 2001 From: Kopachyov Vitaliy Date: Sun, 26 May 2019 14:13:58 +0300 Subject: [PATCH] test: switch actual value argument and expected in deepStrictEqual call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace deepStrictEqual call to have actual value as the first argument and the expected value as the second. Change expectedRecvData definition in single place. PR-URL: https://github.com/nodejs/node/pull/27888 Reviewed-By: Anna Henningsen Reviewed-By: Ujjwal Sharma Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Rich Trott Reviewed-By: Gireesh Punathil Reviewed-By: Yongsheng Zhang --- test/parallel/test-http-upgrade-client.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-http-upgrade-client.js b/test/parallel/test-http-upgrade-client.js index c637324a53d801..d18ac273d6dab1 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -31,6 +31,8 @@ const http = require('http'); const net = require('net'); const Countdown = require('../common/countdown'); +const expectedRecvData = 'nurtzo'; + // Create a TCP server const srv = net.createServer(function(c) { c.on('data', function(d) { @@ -39,7 +41,7 @@ const srv = net.createServer(function(c) { c.write('connection: upgrade\r\n'); c.write('upgrade: websocket\r\n'); c.write('\r\n'); - c.write('nurtzo'); + c.write(expectedRecvData); }); c.on('end', function() { @@ -77,7 +79,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { }); socket.on('close', common.mustCall(function() { - assert.strictEqual(recvData.toString(), 'nurtzo'); + assert.strictEqual(recvData.toString(), expectedRecvData); })); console.log(res.headers); @@ -86,8 +88,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { connection: 'upgrade', upgrade: 'websocket' }; - assert.deepStrictEqual(expectedHeaders, res.headers); - + assert.deepStrictEqual(res.headers, expectedHeaders); socket.end(); countdown.dec(); }));