From 2c87c004e91df0826430f45b2f0de5984b03f110 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 11 Feb 2022 19:39:14 +0100 Subject: [PATCH 1/2] test: fix intl tests on small-icu builds --- 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..8ca08653b613b5 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 Node.js was built with small ICU.'); + return; + } // Number format resolved options { const numberFormat = new Intl.NumberFormat('en-US', { style: 'percent' }); From 6d9db07eaaf118926eff4263159ef917457e1629 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 12 Feb 2022 13:16:27 +0100 Subject: [PATCH 2/2] fixup! test: fix intl tests on small-icu builds --- test/parallel/test-intl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index 8ca08653b613b5..7d1742f2c7d1c6 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -106,8 +106,8 @@ if (!common.hasIntl) { } // 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 Node.js was built with small ICU.'); + common.printSkipMessage('detailed Intl tests because American English is ' + + 'not listed as supported.'); return; } // Number format resolved options