From f848701581c1e32e39c2ec2b97c38dd3e243ef96 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 --- 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'); -}); +}));