summaryrefslogtreecommitdiff
path: root/test/parallel/test-net-connect-immediate-finish.js
blob: 6114233677f5cb8c829ffd23ac10bec70a9dfed4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'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();