diff --git a/test/parallel/test-dgram-empty-packet.js b/test/parallel/test-dgram-empty-packet.js index 1c7e7205d1..34bce4e07a 100644 --- a/test/parallel/test-dgram-empty-packet.js +++ b/test/parallel/test-dgram-empty-packet.js @@ -1,22 +1,22 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); +const dgram = require('dgram'); -var dgram = require('dgram'); -var callbacks = 0; -var client; -var timer; +let callbacks = 0; +let timer; if (common.isOSX) { common.skip('because of 17894467 Apple bug'); return; } -client = dgram.createSocket('udp4'); +const client = dgram.createSocket('udp4'); client.bind(0, function() { + function callback() { callbacks++; - if (callbacks == 2) { + if (callbacks === 2) { clearTimeout(timer); client.close(); } else if (callbacks > 2) {