diff --git a/test/parallel/test-dgram-send-callback-multi-buffer.js b/test/parallel/test-dgram-send-callback-multi-buffer.js index f77b5618450095..09f01f6e8adccc 100644 --- a/test/parallel/test-dgram-send-callback-multi-buffer.js +++ b/test/parallel/test-dgram-send-callback-multi-buffer.js @@ -6,19 +6,19 @@ const dgram = require('dgram'); const client = dgram.createSocket('udp4'); -const messageSent = common.mustCall(function messageSent(err, bytes) { +const messageSent = common.mustCall((err, bytes) => { assert.strictEqual(bytes, buf1.length + buf2.length); }); const buf1 = Buffer.alloc(256, 'x'); const buf2 = Buffer.alloc(256, 'y'); -client.on('listening', function() { - const port = this.address().port; +client.on('listening', () => { + const port = client.address().port; client.send([buf1, buf2], port, common.localhostIPv4, messageSent); }); -client.on('message', common.mustCall(function onMessage(buf, info) { +client.on('message', common.mustCall((buf, info) => { const expected = Buffer.concat([buf1, buf2]); assert.ok(buf.equals(expected), 'message was received correctly'); client.close();