summaryrefslogtreecommitdiff
path: root/test/parallel/test-dgram-close-is-not-callback.js
blob: d0f23d5808c7b7ef92bf7c27d91ee5577c39e896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict';
const common = require('../common');
const dgram = require('dgram');

const buf = Buffer.alloc(1024, 42);

const socket = dgram.createSocket('udp4');

socket.send(buf, 0, buf.length, common.PORT, 'localhost');

// if close callback is not function, ignore the argument.
socket.close('bad argument');

socket.on('close', common.mustCall(function() {}));