summaryrefslogtreecommitdiff
path: root/test/parallel/test-icu-data-dir.js
blob: 5619d934020aced760c41f9cdc4eed25c4f050c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';
const common = require('../common');
if (!(common.hasIntl && common.hasSmallICU)) {
  common.skip('missing Intl');
  return;
}
const assert = require('assert');
const { spawnSync } = require('child_process');

const expected =
    'could not initialize ICU (check NODE_ICU_DATA or ' +
    '--icu-data-dir parameters)' + (common.isWindows ? '\r\n' : '\n');

{
  const child = spawnSync(process.execPath, ['--icu-data-dir=/', '-e', '0']);
  assert(child.stderr.toString().includes(expected));
}

{
  const env = { NODE_ICU_DATA: '/' };
  const child = spawnSync(process.execPath, ['-e', '0'], { env });
  assert(child.stderr.toString().includes(expected));
}