test262/test/intl402/DurationFormat/constructor-options-fractionalDigits-valid.js
Romulo Cintra 28455b13f5
Intl.DurationFormat update coverage (#3501)
* constructor tests coverage
* add localeMatcher tests
* add styles and numbering system tests
* re-organize folder and files structure
2022-05-03 08:19:32 -07:00

26 lines
765 B
JavaScript

// Copyright 2022 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.DurationFormat
description: Tests that the option localeMatcher is processed correctly.
info: |
Intl.DurationFormat ( [ locales [ , options ] ] )
(...)
18. Set durationFormat.[[FractionalDigits]] to ? GetNumberOption(options, "fractionalDigits", 0, 9, undefined).
features: [Intl.DurationFormat]
---*/
const validOptions = [
undefined,
0,
1,
5,
9
];
for (const fractionalDigits of validOptions) {
const obj = new Intl.DurationFormat("en", {fractionalDigits});
assert.sameValue(obj.resolvedOptions().fractionalDigits, fractionalDigits, `${fractionalDigits} is supported by DurationFormat`);
}