test: use arrow syntax for anonymous callbacks
PR-URL: https://github.com/nodejs/node/pull/24691 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
parent
171b8108df
commit
01c5c16aba
@ -6,7 +6,7 @@ const net = require('net');
|
|||||||
const { internalBinding } = require('internal/test/binding');
|
const { internalBinding } = require('internal/test/binding');
|
||||||
const TCPWrap = internalBinding('tcp_wrap').TCP;
|
const TCPWrap = internalBinding('tcp_wrap').TCP;
|
||||||
|
|
||||||
const echoServer = net.createServer(function(conn) {
|
const echoServer = net.createServer((conn) => {
|
||||||
conn.end();
|
conn.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ echoServer.on('listening', function() {
|
|||||||
sock.unref();
|
sock.unref();
|
||||||
sock.ref();
|
sock.ref();
|
||||||
sock.connect(this.address().port);
|
sock.connect(this.address().port);
|
||||||
sock.on('end', function() {
|
sock.on('end', () => {
|
||||||
assert.strictEqual(refCount, 0);
|
assert.strictEqual(refCount, 0);
|
||||||
echoServer.close();
|
echoServer.close();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user