node/test/parallel/test-dgram-ref.js
cjihrig b471392f8c test: increase dgram ref()/unref() coverage
This commit completes code coverage for dgram's Socket#ref() and
Socket#unref() methods.

PR-URL: https://github.com/nodejs/node/pull/11240
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-10 12:42:20 -05:00

15 lines
316 B
JavaScript

'use strict';
const common = require('../common');
const dgram = require('dgram');
// should not hang, see #1282
dgram.createSocket('udp4');
dgram.createSocket('udp6');
{
// Test the case of ref()'ing a socket with no handle.
const s = dgram.createSocket('udp4');
s.close(common.mustCall(() => s.ref()));
}