From a4fff9a72f036a5e5dfa88757d1dd0796e1e2dad Mon Sep 17 00:00:00 2001 From: tongshouyu Date: Sun, 28 Apr 2019 16:50:27 +0800 Subject: [PATCH] test: add mustCall to test-net-eaddrinuse test PR-URL: https://github.com/nodejs/node/pull/27448 Reviewed-By: Yongsheng Zhang Reviewed-By: Weijia Wang Reviewed-By: Gireesh Punathil Reviewed-By: Colin Ihrig --- test/parallel/test-net-eaddrinuse.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -}); +}));