mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
570 B
22 lines
570 B
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
const net = require('net');
|
|
|
|
const host = '*'.repeat(256);
|
|
|
|
function do_not_call() {
|
|
throw new Error('This function should not have been called.');
|
|
}
|
|
|
|
const 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);
|
|
});
|
|
|