diff --git a/test/parallel/test-dgram-send-bad-arguments.js b/test/parallel/test-dgram-send-bad-arguments.js index e96a01de3281f2..4eb7dca7a38e5d 100644 --- a/test/parallel/test-dgram-send-bad-arguments.js +++ b/test/parallel/test-dgram-send-bad-arguments.js @@ -28,17 +28,17 @@ const buf = Buffer.from('test'); const host = '127.0.0.1'; const sock = dgram.createSocket('udp4'); -assert.throws(function() { +assert.throws(() => { sock.send(); }, TypeError); // First argument should be a buffer. // send(buf, offset, length, port, host) -assert.throws(function() { sock.send(buf, 1, 1, -1, host); }, RangeError); -assert.throws(function() { sock.send(buf, 1, 1, 0, host); }, RangeError); -assert.throws(function() { sock.send(buf, 1, 1, 65536, host); }, RangeError); +assert.throws(() => { sock.send(buf, 1, 1, -1, host); }, RangeError); +assert.throws(() => { sock.send(buf, 1, 1, 0, host); }, RangeError); +assert.throws(() => { sock.send(buf, 1, 1, 65536, host); }, RangeError); // send(buf, port, host) -assert.throws(function() { sock.send(23, 12345, host); }, TypeError); +assert.throws(() => { sock.send(23, 12345, host); }, TypeError); // send([buf1, ..], port, host) -assert.throws(function() { sock.send([buf, 23], 12345, host); }, TypeError); +assert.throws(() => { sock.send([buf, 23], 12345, host); }, TypeError);