mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
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>
17 lines
395 B
JavaScript
17 lines
395 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
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(), expectedError);
|
|
} else {
|
|
assert.doesNotThrow(() => util.assertCrypto());
|
|
}
|