Skip to content

Commit f5bb1b3

Browse files
VetoS88targos
authored andcommittedMay 28, 2019
test: switch actual value argument and expected in deepStrictEqual call
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: #27888 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 531669b commit f5bb1b3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎test/parallel/test-http-upgrade-client.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const http = require('http');
3131
const net = require('net');
3232
const Countdown = require('../common/countdown');
3333

34+
const expectedRecvData = 'nurtzo';
35+
3436
// Create a TCP server
3537
const srv = net.createServer(function(c) {
3638
c.on('data', function(d) {
@@ -39,7 +41,7 @@ const srv = net.createServer(function(c) {
3941
c.write('connection: upgrade\r\n');
4042
c.write('upgrade: websocket\r\n');
4143
c.write('\r\n');
42-
c.write('nurtzo');
44+
c.write(expectedRecvData);
4345
});
4446

4547
c.on('end', function() {
@@ -77,7 +79,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() {
7779
});
7880

7981
socket.on('close', common.mustCall(function() {
80-
assert.strictEqual(recvData.toString(), 'nurtzo');
82+
assert.strictEqual(recvData.toString(), expectedRecvData);
8183
}));
8284

8385
console.log(res.headers);
@@ -86,8 +88,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() {
8688
connection: 'upgrade',
8789
upgrade: 'websocket'
8890
};
89-
assert.deepStrictEqual(expectedHeaders, res.headers);
90-
91+
assert.deepStrictEqual(res.headers, expectedHeaders);
9192
socket.end();
9293
countdown.dec();
9394
}));

0 commit comments

Comments
 (0)
Please sign in to comment.