Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-icu-data-dir.js « parallel « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f1da0dc685ae9d4851e1f42c91458db77f4549e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Flags: --expose-internals
'use strict';
const common = require('../common');
const { internalBinding } = require('internal/test/binding');
const os = require('os');

const { hasSmallICU } = internalBinding('config');
if (!(common.hasIntl && 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 = { ...process.env, NODE_ICU_DATA: '/' };
  const child = spawnSync(process.execPath, ['-e', '0'], { env });
  assert(child.stderr.toString().includes(expected));
}