test262/test/built-ins/Temporal/PlainTime/from/plaintime-propertybag-no-time-units.js
Philip Chimento 4158545044 Temporal.PlainTime property bags
Tests for the normative change to Temporal made in
https://github.com/tc39/proposal-temporal/pull/1862
2021-11-01 14:07:02 -04:00

17 lines
585 B
JavaScript

// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaintime.from
description: Missing time units in property bag default to 0
includes: [temporalHelpers.js]
features: [Temporal]
---*/
const props = {};
assert.throws(TypeError, () => Temporal.PlainTime.from(props), "TypeError if at least one property is not present");
props.minute = 30;
const result = Temporal.PlainTime.from(props);
TemporalHelpers.assertPlainTime(result, 0, 30, 0, 0, 0, 0, "missing time units default to 0");