Skip to content

Commit

Permalink
test: modernized test to use arrow functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ggoforth authored and MylesBorins committed Nov 29, 2018
1 parent 66119ed commit 85059a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-dgram-send-callback-multi-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 85059a9

Please sign in to comment.