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

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>
15 lines
348 B
JavaScript
15 lines
348 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var net = require('net');
|
|
var assert = require('assert');
|
|
|
|
var c = net.createConnection(common.PORT, '***');
|
|
|
|
c.on('connect', common.fail);
|
|
|
|
c.on('error', common.mustCall(function(e) {
|
|
assert.equal(e.code, 'ENOTFOUND');
|
|
assert.equal(e.port, common.PORT);
|
|
assert.equal(e.hostname, '***');
|
|
}));
|