nodejs/test/parallel/test-process-features.js
Shelley Vohr 2b425345fe
crypto: expose crypto.constants.OPENSSL_IS_BORINGSSL
PR-URL: https://github.com/nodejs/node/pull/58387
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-05-22 11:04:16 +00:00

27 lines
784 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const actualKeys = new Set(Object.keys(process.features));
const expectedKeys = new Map([
['inspector', ['boolean']],
['debug', ['boolean']],
['uv', ['boolean']],
['ipv6', ['boolean']],
['openssl_is_boringssl', ['boolean']],
['tls_alpn', ['boolean']],
['tls_sni', ['boolean']],
['tls_ocsp', ['boolean']],
['tls', ['boolean']],
['cached_builtins', ['boolean']],
['require_module', ['boolean']],
['typescript', ['boolean', 'string']],
]);
assert.deepStrictEqual(actualKeys, new Set(expectedKeys.keys()));
for (const [key, expected] of expectedKeys) {
assert.ok(expected.includes(typeof process.features[key]), `typeof process.features.${key} is not one of [${expected.join(', ')}]`);
}