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 <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

Backport-PR-URL: #39051
  • Loading branch information
richardlau committed Jul 20, 2021
1 parent 9b69069 commit 45c2ea3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/parallel/test-intl.js
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 45c2ea3

Please sign in to comment.