Merge pull request #1936 from ryzokuken/dtf-constructor-options-default

intl: increase coverage for DateTimeFormat
This commit is contained in:
Rick Waldron 2018-11-08 09:16:51 -05:00 committed by GitHub
commit 9d2ae66ac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
// Copyright (C) 2018 Ujjwal Sharma. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-initializedatetimeformat
description: >
Tests that the constructor for Intl.DateTimeFormat uses appropriate default
values for its arguments (locales and options).
---*/
const actual = new Intl.DateTimeFormat().resolvedOptions();
const expected = new Intl.DateTimeFormat(
[],
Object.create(null)
).resolvedOptions();
assert.sameValue(actual.locale, expected.locale);
assert.sameValue(actual.calendar, expected.calendar);
assert.sameValue(actual.day, expected.day);
assert.sameValue(actual.month, expected.month);
assert.sameValue(actual.year, expected.year);
assert.sameValue(actual.numberingSystem, expected.numberingSystem);
assert.sameValue(actual.timeZone, expected.timeZone);