node/test/parallel/test-process-versions.js
Michael Dawson 62427bbed9 n-api: expose n-api version in process.versions
Expose n-api version in process.versions so that it is
available for use in javascript by external modules
like node-pre-gyp. It was previously accessible through
a functon available in the N-API.

Backport-PR-URL: https://github.com/nodejs/node/pull/19447
PR-URL: https://github.com/nodejs/node/pull/18067
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießn <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-04-16 17:46:13 -04:00

19 lines
451 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const expected_keys = ['ares', 'http_parser', 'modules', 'node',
'uv', 'v8', 'zlib', 'napi'];
if (common.hasCrypto) {
expected_keys.push('openssl');
}
if (common.hasIntl) {
expected_keys.push('icu');
}
expected_keys.sort();
const actual_keys = Object.keys(process.versions).sort();
assert.deepStrictEqual(actual_keys, expected_keys);