Skip to content

Commit

Permalink
test: add NumberFormat resolvedOptions test
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
richardlau committed Jul 19, 2021
1 parent b79b4cb commit 3f81a84
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/parallel/test-intl.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ if (!common.hasIntl) {
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
assert.strictEqual(numberFormat, '12,345.679');
}
// Number format resolved options
{
const numberFormat = new Intl.NumberFormat('en-US', { style: 'percent' });
const resolvedOptions = numberFormat.resolvedOptions();
assert.strictEqual(resolvedOptions.locale, 'en-US');
assert.strictEqual(resolvedOptions.style, 'percent');
}
// Significant Digits
{
const loc = ['en-US'];
Expand Down

0 comments on commit 3f81a84

Please sign in to comment.