mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 03:13:13 +00:00

PR-URL: https://github.com/nodejs/node/pull/10550 Reviewed-By: Rich Trott <rtrott@gmail.com>
23 lines
566 B
JavaScript
23 lines
566 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
const net = require('net');
|
|
|
|
var host = '*'.repeat(256);
|
|
|
|
function do_not_call() {
|
|
throw new Error('This function should not have been called.');
|
|
}
|
|
|
|
var socket = net.connect(42, host, do_not_call);
|
|
socket.on('error', common.mustCall(function(err) {
|
|
assert.equal(err.code, 'ENOTFOUND');
|
|
}));
|
|
socket.on('lookup', function(err, ip, type) {
|
|
assert(err instanceof Error);
|
|
assert.equal(err.code, 'ENOTFOUND');
|
|
assert.equal(ip, undefined);
|
|
assert.equal(type, undefined);
|
|
});
|