Skip to content

Commit e9962b9

Browse files
annatangzhaojasnell
authored andcommitted
test: change to arrow functions in send-bad-arguments
PR-URL: #23483 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
1 parent 35d9990 commit e9962b9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/parallel/test-dgram-send-bad-arguments.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ const buf = Buffer.from('test');
2828
const host = '127.0.0.1';
2929
const sock = dgram.createSocket('udp4');
3030

31-
assert.throws(function() {
31+
assert.throws(() => {
3232
sock.send();
3333
}, TypeError); // First argument should be a buffer.
3434

3535
// send(buf, offset, length, port, host)
36-
assert.throws(function() { sock.send(buf, 1, 1, -1, host); }, RangeError);
37-
assert.throws(function() { sock.send(buf, 1, 1, 0, host); }, RangeError);
38-
assert.throws(function() { sock.send(buf, 1, 1, 65536, host); }, RangeError);
36+
assert.throws(() => { sock.send(buf, 1, 1, -1, host); }, RangeError);
37+
assert.throws(() => { sock.send(buf, 1, 1, 0, host); }, RangeError);
38+
assert.throws(() => { sock.send(buf, 1, 1, 65536, host); }, RangeError);
3939

4040
// send(buf, port, host)
41-
assert.throws(function() { sock.send(23, 12345, host); }, TypeError);
41+
assert.throws(() => { sock.send(23, 12345, host); }, TypeError);
4242

4343
// send([buf1, ..], port, host)
44-
assert.throws(function() { sock.send([buf, 23], 12345, host); }, TypeError);
44+
assert.throws(() => { sock.send([buf, 23], 12345, host); }, TypeError);

0 commit comments

Comments
 (0)