Skip to content

Commit e76736a

Browse files
richardlautargos
authored andcommitted
test: add NumberFormat resolvedOptions test
Add a regression test for NumberFormat resolvedOptions. PR-URL: nodejs#39401 Refs: nodejs#39050 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent e3cfbd9 commit e76736a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/parallel/test-intl.js

+7
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ if (!common.hasIntl) {
104104
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
105105
assert.strictEqual(numberFormat, '12,345.679');
106106
}
107+
// Number format resolved options
108+
{
109+
const numberFormat = new Intl.NumberFormat('en-US', { style: 'percent' });
110+
const resolvedOptions = numberFormat.resolvedOptions();
111+
assert.strictEqual(resolvedOptions.locale, 'en-US');
112+
assert.strictEqual(resolvedOptions.style, 'percent');
113+
}
107114
// Significant Digits
108115
{
109116
const loc = ['en-US'];

0 commit comments

Comments
 (0)