diff options
author | Mithun Sasidharan <mithunsasidharan89@gmail.com> | 2017-12-08 22:44:28 +0530 |
---|---|---|
committer | Jon Moss <me@jonathanmoss.me> | 2017-12-11 15:19:11 -0500 |
commit | f3aaaa52b738e20192468a5157721c0a62027a16 (patch) | |
tree | 3b24764fd0dce4e9d3d8047dd6615a27fee49650 /test | |
parent | 8d23afc807303a9afc1851802e1d88f0d3a84c29 (diff) | |
download | node-new-f3aaaa52b738e20192468a5157721c0a62027a16.tar.gz |
test: refactored to remove unnecessary variables
PR-URL: https://github.com/nodejs/node/pull/17553
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-net-connect-options-fd.js | 5 | ||||
-rw-r--r-- | test/parallel/test-net-connect-options-path.js | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/test/parallel/test-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js index 1ffc92257c..50c2a08efe 100644 --- a/test/parallel/test-net-connect-options-fd.js +++ b/test/parallel/test-net-connect-options-fd.js @@ -83,14 +83,13 @@ const forAllClients = (cb) => common.mustCall(cb, CLIENT_VARIANTS); path: serverPath }); const getConnectCb = (index) => common.mustCall(function clientOnConnect() { - const client = this; // Test if it's wrapping an existing fd assert(handleMap.has(index)); const oldHandle = handleMap.get(index); assert.strictEqual(oldHandle.fd, this._handle.fd); - client.write(String(oldHandle.fd)); + this.write(String(oldHandle.fd)); console.error(`[Pipe]Sending data through fd ${oldHandle.fd}`); - client.on('error', function(err) { + this.on('error', function(err) { console.error(err); assert.fail(null, null, `[Pipe Client]${err}`); }); diff --git a/test/parallel/test-net-connect-options-path.js b/test/parallel/test-net-connect-options-path.js index 07c5446fc6..3868b85a78 100644 --- a/test/parallel/test-net-connect-options-path.js +++ b/test/parallel/test-net-connect-options-path.js @@ -20,9 +20,8 @@ const CLIENT_VARIANTS = 12; }, CLIENT_VARIANTS)) .listen(serverPath, common.mustCall(function() { const getConnectCb = () => common.mustCall(function() { - const client = this; - client.end(); - client.on('close', common.mustCall(function() { + this.end(); + this.on('close', common.mustCall(function() { counter++; if (counter === CLIENT_VARIANTS) { server.close(); |