Skip to content

Commit 45c2ea3

Browse files
committed
test: add NumberFormat resolvedOptions test
Add a regression test for NumberFormat resolvedOptions. PR-URL: #39401 Refs: #39050 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Backport-PR-URL: #39051
1 parent 9b69069 commit 45c2ea3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎test/parallel/test-intl.js‎

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

0 commit comments

Comments
(0)