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 <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
chrisforrette authored and MylesBorins committed Oct 30, 2018
1 parent 01d599c commit e0a3e23
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 e0a3e23

Please sign in to comment.