mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 18:02:21 +00:00

This patch uses `return` statement to skip the test instead of using `process.exit` call. PR-URL: https://github.com/nodejs/io.js/pull/2109 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
25 lines
628 B
JavaScript
25 lines
628 B
JavaScript
'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 fs = require('fs');
|
|
var path = require('path');
|
|
|
|
var cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'));
|
|
var key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'));
|
|
|
|
var conn = tls.connect({cert: cert, key: key, port: common.PORT}, function() {
|
|
assert.ok(false); // callback should never be executed
|
|
});
|
|
conn.on('error', function() {
|
|
});
|
|
assert.doesNotThrow(function() {
|
|
conn.destroy();
|
|
});
|