summaryrefslogtreecommitdiff
path: root/test/parallel/test-tls-client-abort2.js
blob: 194882e7d52e0894bdc653867961612743e8fd98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict';
var common = require('../common');
var assert = require('assert');

if (!common.hasCrypto) {
  console.log('1..0 # Skipped: missing crypto');
  return;
}
var tls = require('tls');

var errors = 0;

var conn = tls.connect(common.PORT, function() {
  assert(false); // callback should never be executed
});
conn.on('error', function() {
  ++errors;
  assert.doesNotThrow(function() {
    conn.destroy();
  });
});

process.on('exit', function() {
  assert.equal(errors, 1);
});