mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
612307564b
The `test/common` module has the capability to identify if any variable is leaked to the global scope and fail the test. So that has to be imported at the beginning. PR-URL: https://github.com/nodejs/node/pull/7786 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
29 lines
494 B
JavaScript
29 lines
494 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
return;
|
|
}
|
|
var tls = require('tls');
|
|
|
|
function Done() {}
|
|
|
|
function test1() {
|
|
var ciphers = '';
|
|
|
|
tls.createSecureContext = function(options) {
|
|
ciphers = options.ciphers;
|
|
throw new Done();
|
|
};
|
|
|
|
try {
|
|
tls.connect(common.PORT);
|
|
} catch (e) {
|
|
assert(e instanceof Done);
|
|
}
|
|
assert.equal(ciphers, tls.DEFAULT_CIPHERS);
|
|
}
|
|
test1();
|