diff --git a/test/parallel/test-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js index e0872cf7c5df3f..1cba6e1251fd21 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 07c5446fc6c0ab..3868b85a78a6d2 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();