From f282e4a94d0ccb37635bd91883692ccfbb80a509 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 14 Feb 2022 18:28:34 +0100 Subject: [PATCH] test: fix intl tests on small-icu builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/41939 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- test/parallel/test-intl.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index 956383c5281389..7d1742f2c7d1c6 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -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' });