11cb0ef41Sopenharmony_ci// Flags: --expose-internals 21cb0ef41Sopenharmony_ci'use strict'; 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciconst { internalBinding } = require('internal/test/binding'); 51cb0ef41Sopenharmony_ciconst os = require('os'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciconst { hasSmallICU } = internalBinding('config'); 81cb0ef41Sopenharmony_ciif (!(common.hasIntl && hasSmallICU)) 91cb0ef41Sopenharmony_ci common.skip('missing Intl'); 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ciconst assert = require('assert'); 121cb0ef41Sopenharmony_ciconst { spawnSync } = require('child_process'); 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ciconst expected = 151cb0ef41Sopenharmony_ci 'could not initialize ICU (check NODE_ICU_DATA or ' + 161cb0ef41Sopenharmony_ci `--icu-data-dir parameters)${os.EOL}`; 171cb0ef41Sopenharmony_ci 181cb0ef41Sopenharmony_ci{ 191cb0ef41Sopenharmony_ci const child = spawnSync(process.execPath, ['--icu-data-dir=/', '-e', '0']); 201cb0ef41Sopenharmony_ci assert(child.stderr.toString().includes(expected)); 211cb0ef41Sopenharmony_ci} 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ci{ 241cb0ef41Sopenharmony_ci const env = { ...process.env, NODE_ICU_DATA: '/' }; 251cb0ef41Sopenharmony_ci const child = spawnSync(process.execPath, ['-e', '0'], { env }); 261cb0ef41Sopenharmony_ci assert(child.stderr.toString().includes(expected)); 271cb0ef41Sopenharmony_ci} 28