mirror of
https://github.com/tc39/test262.git
synced 2025-06-25 00:10:30 +02:00
We already had similar tests to these for other methods, such as Temporal.PlainTime.prototype.equals(). since() and until() should have these tests too. Update assertion messages in all of the existing tests as well, as per Ms2ger's review comment.
16 lines
583 B
JavaScript
16 lines
583 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.compare
|
|
description: Missing time units in property bag default to 0
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const props = {};
|
|
assert.throws(TypeError, () => Temporal.PlainTime.compare(props, new Temporal.PlainTime(0, 30)), "TypeError if no properties are present");
|
|
|
|
props.minute = 30;
|
|
const result = Temporal.PlainTime.compare(props, new Temporal.PlainTime(0, 30));
|
|
assert.sameValue(result, 0, "missing time units default to 0");
|