0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-28 22:46:31 +01:00
nodejs/test/parallel/test-net-better-error-messages-port-hostname.js

14 lines
346 B
JavaScript
Raw Normal View History

var common = require('../common');
var net = require('net');
var assert = require('assert');
var c = net.createConnection(common.PORT, 'blah.blah');
c.on('connect', assert.fail);
c.on('error', common.mustCall(function(e) {
assert.equal(e.code, 'ENOTFOUND');
assert.equal(e.port, common.PORT);
assert.equal(e.hostname, 'blah.blah');
}));