mirror of
https://github.com/tc39/test262.git
synced 2025-10-16 21:38:47 +02:00
Tests for the normative changes made to Temporal in https://github.com/tc39/proposal-temporal/pull/1873 This adds a new Temporal helper calendar that asserts that its dateAdd() method is always called with a PlainDate instance. This allows testing that relativeTo parameters are always converted to PlainDate if they are not ZonedDateTime and not undefined. Prior to the normative PR, they would be converted to PlainDateTime instead. Additionally and optionally, the helper calendar can also assert that its dateAdd() method is called with a specific PlainDate instance. This allows testing that the instance is the same PlainDate passed as the relativeTo parameter (in the case of Duration methods) or is the receiver (in the case of PlainDate methods). For the PlainDateTime and PlainYearMonth methods the PlainDate instance is synthesized internally so there is no need to assert that dateAdd() is called with a specific instance.