Skip to content

Commit

Permalink
test: cleanup vars to const and '==' to '==='
Browse files Browse the repository at this point in the history
Modified test-http-upgrade-client.js

Line 29: Changed var port to const port
Line 30: Changed var headers to const headers
Line 57: Changed assert.equal to assert.strictEqual
Line 61: Changed var expectedHeaders to const
Line 69: Changed '==' to '===' comparison

PR-URL: #8705
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
  • Loading branch information
oogz authored and jasnell committed Sep 29, 2016
1 parent 6e883f1 commit 1f31435
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-http-upgrade-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var srv = net.createServer(function(c) {
});

srv.listen(0, '127.0.0.1', common.mustCall(function() {
var port = this.address().port;
var headers = [
const port = this.address().port;
const headers = [
{
connection: 'upgrade',
upgrade: 'websocket'
Expand All @@ -54,19 +54,19 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() {
});

socket.on('close', common.mustCall(function() {
assert.equal(recvData, 'nurtzo');
assert.strictEqual(recvData.toString(), 'nurtzo');
}));

console.log(res.headers);
var expectedHeaders = {
const expectedHeaders = {
hello: 'world',
connection: 'upgrade',
upgrade: 'websocket'
};
assert.deepStrictEqual(expectedHeaders, res.headers);

socket.end();
if (--left == 0)
if (--left === 0)
srv.close();
}));
req.on('close', common.mustCall(function() {
Expand Down

0 comments on commit 1f31435

Please sign in to comment.