Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: add common.mustCall test-dgram-listen-after-bind
  • Loading branch information
zhoujiamin committed Apr 28, 2019
commit f848701581c1e32e39c2ec2b97c38dd3e243ef96
9 changes: 5 additions & 4 deletions test/parallel/test-dgram-listen-after-bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');
const dgram = require('dgram');

Expand All @@ -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');
});
}));