Skip to content

Commit

Permalink
test: modernizing test-dgram-listen-after-bind with arrow functions
Browse files Browse the repository at this point in the history
PR-URL: #23500
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
chrisforrette authored and jasnell committed Oct 17, 2018
1 parent 9430ac2 commit 0eb5f13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-dgram-listen-after-bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ const socket = dgram.createSocket('udp4');
socket.bind();

let fired = false;
const timer = setTimeout(function() {
const timer = setTimeout(() => {
socket.close();
}, 100);

socket.on('listening', function() {
socket.on('listening', () => {
clearTimeout(timer);
fired = true;
socket.close();
});

socket.on('close', function() {
socket.on('close', () => {
assert(fired, 'listening should fire after bind');
});

0 comments on commit 0eb5f13

Please sign in to comment.