mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 17:03:34 +00:00

Wrap expectsError in mustCall to make sure it's really called as expected. PR-URL: https://github.com/nodejs/node/pull/14088 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
16 lines
402 B
JavaScript
16 lines
402 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const util = require('internal/util');
|
|
|
|
if (!process.versions.openssl) {
|
|
const expectedError = common.expectsError({
|
|
code: 'ERR_NO_CRYPTO',
|
|
type: Error
|
|
});
|
|
assert.throws(() => util.assertCrypto(), expectedError);
|
|
} else {
|
|
assert.doesNotThrow(() => util.assertCrypto());
|
|
}
|