0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-global-webcrypto.js
Zihong Qu 74dff83fad
tools: move webcrypto into no-restricted-properties
Since eslint fixed https://github.com/eslint/eslint/issues/16412 and we
are on eslint v8.57.0 so that we can take advantage of
no-restricted-properties rule for webcrypto.

PR-URL: https://github.com/nodejs/node/pull/53023
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-30 20:55:02 +00:00

14 lines
410 B
JavaScript

'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const crypto = require('crypto');
/* eslint-disable no-restricted-properties */
assert.strictEqual(globalThis.crypto, crypto.webcrypto);
assert.strictEqual(Crypto, crypto.webcrypto.constructor);
assert.strictEqual(SubtleCrypto, crypto.webcrypto.subtle.constructor);