Skip to content

Commit c4d67f2

Browse files
zhoujiamintargos
zhoujiamin
authored andcommitted
test: add common.mustCall test-dgram-listen-after-bind
PR-URL: #27454 Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Yorkie Liu <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ouyang Yadong <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 23fb430 commit c4d67f2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/parallel/test-dgram-listen-after-bind.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
'use strict';
2323
require('../common');
24+
const common = require('../common');
2425
const assert = require('assert');
2526
const dgram = require('dgram');
2627

@@ -33,12 +34,12 @@ const timer = setTimeout(() => {
3334
socket.close();
3435
}, 100);
3536

36-
socket.on('listening', () => {
37+
socket.on('listening', common.mustCall(() => {
3738
clearTimeout(timer);
3839
fired = true;
3940
socket.close();
40-
});
41+
}));
4142

42-
socket.on('close', () => {
43+
socket.on('close', common.mustCall(() => {
4344
assert(fired, 'listening should fire after bind');
44-
});
45+
}));

0 commit comments

Comments
 (0)