diff --git a/test/parallel/test-net-eaddrinuse.js b/test/parallel/test-net-eaddrinuse.js index 29508e4582852e..cfe004b6839e9b 100644 --- a/test/parallel/test-net-eaddrinuse.js +++ b/test/parallel/test-net-eaddrinuse.js @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const net = require('net'); @@ -28,10 +28,10 @@ const server1 = net.createServer(function(socket) { }); const server2 = net.createServer(function(socket) { }); -server1.listen(0, function() { +server1.listen(0, common.mustCall(function() { server2.on('error', function(error) { assert.strictEqual(error.message.includes('EADDRINUSE'), true); server1.close(); }); server2.listen(this.address().port); -}); +}));