mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: https://github.com/nodejs/node/pull/64960 Fixes: https://github.com/nodejs/node/issues/48379 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
20 lines
519 B
JavaScript
20 lines
519 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
|
|
common.expectWarning({
|
|
DeprecationWarning: {
|
|
DEP0181: 'crypto.Hmac constructor is deprecated.',
|
|
},
|
|
});
|
|
|
|
const Hmac = crypto.Hmac;
|
|
const instance = crypto.Hmac('sha256', '0123456789abcdef');
|
|
assert(instance instanceof Hmac, 'Hmac is expected to return a new instance' +
|
|
' when called without `new`');
|