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: #39401
Refs: #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 authored and BethGriggs committed Jul 29, 2021
1 parent 68fd6d5 commit 04355af
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 04355af

Please sign in to comment.