test: fix intl tests on small-icu builds

PR-URL: https://github.com/nodejs/node/pull/41939
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Antoine du Hamel authored and GitHub committed 2022-02-14 17:28:34 +00:00
1 parent aff8b874e3
commit f282e4a94d
1 file changed
+6
+6
View File
@@ -104,6 +104,12 @@ if (!common.hasIntl) {
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
assert.strictEqual(numberFormat, '12,345.679');
}
// If list is specified and doesn't contain 'en-US' then return.
if (process.config.variables.icu_locales && !haveLocale('en-US')) {
common.printSkipMessage('detailed Intl tests because American English is ' +
'not listed as supported.');
return;
}
// Number format resolved options
{
const numberFormat = new Intl.NumberFormat('en-US', { style: 'percent' });