test: introduce a helper that checks if crypto is available

since this applies to tls and https (among other things), it'll be used
for those tests as well. if we decouple the build system to somehow support
crypto but not tls, we could refine this.

PR-URL: https://github.com/iojs/io.js/pull/1049
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
This commit is contained in:
Johan Bergström 2015-03-04 11:36:07 +11:00 committed by Shigeki Ohtsu
parent d0e7c359a7
commit 3d5726c4ad

View File

@ -43,6 +43,9 @@ Object.defineProperty(exports, 'opensslCli', {get: function() {
return opensslCli;
}, enumerable: true });
Object.defineProperty(exports, 'hasCrypto', {get: function() {
return process.versions.openssl ? true : false;
}});
if (process.platform === 'win32') {
exports.PIPE = '\\\\.\\pipe\\libuv-test';