node/test/parallel/test-dgram-send-empty-array.js
Peter 07f1efc2ae test: common.fixturesDir -> common.fixtures
Update test-https-agent-session-reuse.js

PR-URL: https://github.com/nodejs/node/pull/16028
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-10-11 13:53:29 -04:00

29 lines
666 B
JavaScript

'use strict';
const common = require('../common');
if (common.isOSX)
common.skip('because of 17894467 Apple bug');
const assert = require('assert');
const dgram = require('dgram');
const client = dgram.createSocket('udp4');
let interval;
client.on('message', common.mustCall(function onMessage(buf, info) {
const expected = Buffer.alloc(0);
assert.ok(buf.equals(expected), `Expected empty message but got ${buf}`);
clearInterval(interval);
client.close();
}));
client.on('listening', common.mustCall(function() {
interval = setInterval(function() {
client.send([], client.address().port, common.localhostIPv4);
}, 10);
}));
client.bind(0);