mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
b0f025208f
For detecting whether `require(esm)` is supported without triggering the experimental warning. PR-URL: https://github.com/nodejs/node/pull/55241 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
26 lines
743 B
JavaScript
26 lines
743 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']],
|
|
['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(', ')}]`);
|
|
}
|