mirror of https://github.com/tc39/test262.git
Temporal: Add a test for PlainTime#toZonedDateTime.
This commit is contained in:
parent
a1a5c91543
commit
7960d616cf
|
@ -0,0 +1,22 @@
|
||||||
|
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-temporal.plaintime.tozoneddatetime
|
||||||
|
description: Both plainDate and timeZone properties need to not be undefined.
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
const instance = new Temporal.PlainTime();
|
||||||
|
const plainDate = new Temporal.PlainDate(2022, 5, 19);
|
||||||
|
const timeZone = new Temporal.TimeZone("UTC");
|
||||||
|
assert.throws(TypeError, () => instance.toZonedDateTime({}),
|
||||||
|
"no properties");
|
||||||
|
assert.throws(TypeError, () => instance.toZonedDateTime({ plainDate }),
|
||||||
|
"only plainDate");
|
||||||
|
assert.throws(TypeError, () => instance.toZonedDateTime({ plainDate, timeZone: undefined }),
|
||||||
|
"timeZone explicitly undefined");
|
||||||
|
assert.throws(TypeError, () => instance.toZonedDateTime({ timeZone }),
|
||||||
|
"only timeZone");
|
||||||
|
assert.throws(TypeError, () => instance.toZonedDateTime({ plainDate: undefined, timeZone }),
|
||||||
|
"plainDate explicitly undefined");
|
Loading…
Reference in New Issue