Skip to content

Commit e0eb19b

Browse files
ggoforthjasnell
authored andcommitted
test: modernized test to use arrow functions
PR-URL: #23496 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent c1ec3bf commit e0eb19b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-dgram-send-callback-multi-buffer.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ const dgram = require('dgram');
66

77
const client = dgram.createSocket('udp4');
88

9-
const messageSent = common.mustCall(function messageSent(err, bytes) {
9+
const messageSent = common.mustCall((err, bytes) => {
1010
assert.strictEqual(bytes, buf1.length + buf2.length);
1111
});
1212

1313
const buf1 = Buffer.alloc(256, 'x');
1414
const buf2 = Buffer.alloc(256, 'y');
1515

16-
client.on('listening', function() {
17-
const port = this.address().port;
16+
client.on('listening', () => {
17+
const port = client.address().port;
1818
client.send([buf1, buf2], port, common.localhostIPv4, messageSent);
1919
});
2020

21-
client.on('message', common.mustCall(function onMessage(buf, info) {
21+
client.on('message', common.mustCall((buf, info) => {
2222
const expected = Buffer.concat([buf1, buf2]);
2323
assert.ok(buf.equals(expected), 'message was received correctly');
2424
client.close();

0 commit comments

Comments
 (0)