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>
This commit is contained in:
parent
8d23afc807
commit
f3aaaa52b7
@ -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}`);
|
||||
});
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user