Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / intl402 / DurationFormat / prototype / format / style-digital-en.js
blobcc2dd3342fd7f3df0128c10058c7a77fde6a135c
1 // |reftest| skip -- Intl.DurationFormat is not supported
2 // Copyright 2022 Igalia, S.L. All rights reserved.
3 // Copyright 2023 Apple Inc. All rights reserved.
4 // This code is governed by the BSD license found in the LICENSE file.
6 /*---
7 esid: sec-Intl.DurationFormat.prototype.format
8 description: Test if format method formats duration correctly with different "style" arguments
9 locale: [en]
10 includes: [testIntl.js]
11 features: [Intl.DurationFormat]
12 ---*/
14 const style = "digital";
16 const duration = {
17   years: 1,
18   months: 2,
19   weeks: 3,
20   days: 3,
21   hours: 4,
22   minutes: 5,
23   seconds: 6,
24   milliseconds: 7,
25   microseconds: 8,
26   nanoseconds: 9,
29 const expected = formatDurationFormatPattern(duration, style);
31 const df = new Intl.DurationFormat("en", {style});
32 assert.sameValue(df.format(duration), expected, `Assert DurationFormat format output using ${style} style option`);
34 reportCompare(0, 0);