mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
1a1ff77feb
Replace '...' as invalid hostname with '***', which will give a more consisten error message on different systems. The hostname '...' returns EAI_AGAIN on musl libc and EAI_NONAME on most other systems. By changing the testcase we get same restult on all known platforms. PR-URL: https://github.com/nodejs/node/pull/5099 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
18 lines
488 B
JavaScript
18 lines
488 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const net = require('net');
|
|
|
|
const client = net.connect({host: '***', port: common.PORT});
|
|
|
|
client.once('error', common.mustCall(function(err) {
|
|
assert(err);
|
|
assert.strictEqual(err.code, err.errno);
|
|
assert.strictEqual(err.code, 'ENOTFOUND');
|
|
assert.strictEqual(err.host, err.hostname);
|
|
assert.strictEqual(err.host, '***');
|
|
assert.strictEqual(err.syscall, 'getaddrinfo');
|
|
}));
|
|
|
|
client.end();
|