From b46d8cdcde8d5a8b4ba127da65610eb1cf0193c8 Mon Sep 17 00:00:00 2001 From: oogz Date: Wed, 21 Sep 2016 14:56:10 -0700 Subject: [PATCH] test: cleanup vars to const and '==' to '===' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/8705 Reviewed-By: James M Snell Reviewed-By: Teddy Katz Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Michaƫl Zasso Reviewed-By: Ilkka Myller --- test/parallel/test-http-upgrade-client.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-http-upgrade-client.js b/test/parallel/test-http-upgrade-client.js index 6543e7dc22..51c70122b9 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -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' @@ -54,11 +54,11 @@ 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' @@ -66,7 +66,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { assert.deepStrictEqual(expectedHeaders, res.headers); socket.end(); - if (--left == 0) + if (--left === 0) srv.close(); })); req.on('close', common.mustCall(function() {