mirror of https://github.com/lukechilds/node.git
Browse Source
PR-URL: https://github.com/nodejs/node/pull/11301 Refs: https://github.com/nodejs/node/issues/11273 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <fhinkel@vt.edu> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>v6
Sebastian Van Sande
8 years ago
committed by
Tobias Nießen
4 changed files with 16 additions and 7 deletions
@ -1,14 +1,16 @@ |
|||
// Flags: --expose-internals
|
|||
'use strict'; |
|||
require('../common'); |
|||
const common = require('../common'); |
|||
const assert = require('assert'); |
|||
const util = require('internal/util'); |
|||
|
|||
const expectedError = common.expectsError({ |
|||
code: 'ERR_NO_CRYPTO', |
|||
type: Error |
|||
}); |
|||
|
|||
if (!process.versions.openssl) { |
|||
assert.throws( |
|||
() => util.assertCrypto(), |
|||
/^Error: Node\.js is not compiled with openssl crypto support$/ |
|||
); |
|||
assert.throws(() => util.assertCrypto(), expectedError); |
|||
} else { |
|||
assert.doesNotThrow(() => util.assertCrypto()); |
|||
} |
|||
|
Loading…
Reference in new issue