From c4d67f2af5763cebc893bfe0587ce10d9a81b3fe Mon Sep 17 00:00:00 2001 From: zhoujiamin Date: Sun, 28 Apr 2019 16:51:43 +0800 Subject: [PATCH] test: add common.mustCall test-dgram-listen-after-bind PR-URL: https://github.com/nodejs/node/pull/27454 Reviewed-By: Weijia Wang Reviewed-By: Yorkie Liu Reviewed-By: Gireesh Punathil Reviewed-By: Colin Ihrig Reviewed-By: Ouyang Yadong Reviewed-By: Rich Trott Reviewed-By: Yongsheng Zhang --- test/parallel/test-dgram-listen-after-bind.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-dgram-listen-after-bind.js b/test/parallel/test-dgram-listen-after-bind.js index 6a7e156e008a77..a580a2386b8ea0 100644 --- a/test/parallel/test-dgram-listen-after-bind.js +++ b/test/parallel/test-dgram-listen-after-bind.js @@ -21,6 +21,7 @@ 'use strict'; require('../common'); +const common = require('../common'); const assert = require('assert'); const dgram = require('dgram'); @@ -33,12 +34,12 @@ const timer = setTimeout(() => { socket.close(); }, 100); -socket.on('listening', () => { +socket.on('listening', common.mustCall(() => { clearTimeout(timer); fired = true; socket.close(); -}); +})); -socket.on('close', () => { +socket.on('close', common.mustCall(() => { assert(fired, 'listening should fire after bind'); -}); +}));