node/test/parallel/test-icu-data-dir.js
Gibson Fahnestock 180f86507d
test: remove envPlus, use Object.assign everywhere
PR-URL: https://github.com/nodejs/node/pull/14845
Fixes: https://github.com/nodejs/node/issues/14823
Refs: https://github.com/nodejs/node/pull/14822
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-09-03 17:28:50 -03:00

24 lines
688 B
JavaScript

'use strict';
const common = require('../common');
const os = require('os');
if (!(common.hasIntl && common.hasSmallICU))
common.skip('missing Intl');
const assert = require('assert');
const { spawnSync } = require('child_process');
const expected =
'could not initialize ICU (check NODE_ICU_DATA or ' +
`--icu-data-dir parameters)${os.EOL}`;
{
const child = spawnSync(process.execPath, ['--icu-data-dir=/', '-e', '0']);
assert(child.stderr.toString().includes(expected));
}
{
const env = Object.assign({}, process.env, { NODE_ICU_DATA: '/' });
const child = spawnSync(process.execPath, ['-e', '0'], { env });
assert(child.stderr.toString().includes(expected));
}