Skip to content

Testing the Temporal proposal #3002

Open

Description

The Temporal proposal reached Stage 3 on 2021-03-10, and like all ECMA262 proposals, it needs coverage in Test262 to advance to Stage 4. In terms of normative text, it is easily the largest proposal we've seen. Testing it will definitely require significant time, effort, and coordination (even with the proposal's existing tests as a starting point). We'd like to document progress publicly for transparency and to encourage participation.

To get the ball rolling, I'm suggesting that we track progress on an per-API basis using this GitHub.com issue. Compared to alternatives like collaborative document editing services and an in-repository text file, this seems like it balances ease of hosting, maintainability, and proximity to the tests. This approach worked well for ES6's well-known Symbols--the most similar (though much smaller) effort that comes to mind.

Working mode

Anyone can comment here when they'd like to begin writing tests for a specific API. A maintainer will update the list to reflect the ongoing and completed work. When you submit a pull request, please mention this issue (just write "gh-3002") so GitHub displays the status of your work in this thread.

Tests for multiple APIs can be submitted in a single pull request, but patches should be small enough for another contributor to review them in a single session. For instance, it probably makes sense to submit tests for all of the @@toStringTag methods in one patch. There's some subjectivity here, but when in doubt, we should err on the side of smaller patches (and remain open to reviewers' requests to break up pull requests).

Status

  • Temporal.now.timeZone (reviewed @Ms2ger 2022-04-13)
  • Temporal.now.instant (reviewed @Ms2ger 2022-04-13)
  • Temporal.Now.plainDateTime
  • Temporal.Now.plainDateTimeISO
  • Temporal.Now.zonedDateTime
  • Temporal.Now.zonedDateTimeISO
  • Temporal.Now.plainDate
  • Temporal.Now.plainDateISO
  • Temporal.Now.plainTimeISO
  • Temporal.PlainDate (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.from (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.compare (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.constructor (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainDate.prototype.calendar (reviewed @Ms2ger 2022-05-25)
  • Temporal.PlainDate.prototype.year (reviewed @Ms2ger 2022-05-25)
  • Temporal.PlainDate.prototype.month (reviewed @Ms2ger 2022-05-25)
  • Temporal.PlainDate.prototype.monthCode (reviewed @Ms2ger 2022-05-25)
  • Temporal.PlainDate.prototype.day (reviewed @Ms2ger 2022-05-25)
  • Temporal.PlainDate.prototype.dayOfWeek (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.dayOfYear (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.weekOfYear (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.daysInWeek (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.daysInMonth (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.daysInYear (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.monthsInYear (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.inLeapYear (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.toPlainYearMonth (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.toPlainMonthDay (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.getISOFields (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.add (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.subtract (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.with (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.withCalendar (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.until (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.since (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.equals (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.toPlainDateTime (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.toZonedDateTime (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.toString (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.toLocaleString
  • Temporal.PlainDate.prototype.toJSON (reviewed @Ms2ger 2022-06-20)
  • Temporal.PlainDate.prototype.valueOf (reviewed @Ms2ger 2022-05-25)
  • Temporal.PlainTime
  • Temporal.PlainTime.from
  • Temporal.PlainTime.compare
  • Temporal.PlainTime.prototype.constructor (reviewed @ptomato 2022-08-03)
  • Temporal.PlainTime.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainTime.prototype.calendar (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainTime.prototype.hour (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainTime.prototype.minute (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainTime.prototype.second (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainTime.prototype.millisecond (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainTime.prototype.microsecond (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainTime.prototype.nanosecond (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainTime.prototype.add
  • Temporal.PlainTime.prototype.subtract
  • Temporal.PlainTime.prototype.with
  • Temporal.PlainTime.prototype.until
  • Temporal.PlainTime.prototype.since
  • Temporal.PlainTime.prototype.round
  • Temporal.PlainTime.prototype.equals
  • Temporal.PlainTime.prototype.toPlainDateTime
  • Temporal.PlainTime.prototype.toZonedDateTime
  • Temporal.PlainTime.prototype.getISOFields (reviewed @ptomato 2022-08-03)
  • Temporal.PlainTime.prototype.toString
  • Temporal.PlainTime.prototype.toLocaleString
  • Temporal.PlainTime.prototype.toJSON (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainTime.prototype.valueOf (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainDateTime
  • Temporal.PlainDateTime.from
  • Temporal.PlainDateTime.compare
  • Temporal.PlainDateTime.prototype.constructor (reviewed @ptomato 2022-08-03)
  • Temporal.PlainDateTime.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainDateTime.prototype.calendar
  • Temporal.PlainDateTime.prototype.year
  • Temporal.PlainDateTime.prototype.month
  • Temporal.PlainDateTime.prototype.monthCode
  • Temporal.PlainDateTime.prototype.day
  • Temporal.PlainDateTime.prototype.hour
  • Temporal.PlainDateTime.prototype.minute
  • Temporal.PlainDateTime.prototype.second
  • Temporal.PlainDateTime.prototype.millisecond
  • Temporal.PlainDateTime.prototype.microsecond
  • Temporal.PlainDateTime.prototype.nanosecond
  • Temporal.PlainDateTime.prototype.dayOfWeek
  • Temporal.PlainDateTime.prototype.dayOfYear
  • Temporal.PlainDateTime.prototype.weekOfYear
  • Temporal.PlainDateTime.prototype.daysInWeek
  • Temporal.PlainDateTime.prototype.daysInMonth
  • Temporal.PlainDateTime.prototype.daysInYear
  • Temporal.PlainDateTime.prototype.monthsInYear
  • Temporal.PlainDateTime.prototype.inLeapYear
  • Temporal.PlainDateTime.prototype.with
  • Temporal.PlainDateTime.prototype.withPlainTime
  • Temporal.PlainDateTime.prototype.withPlainDate
  • Temporal.PlainDateTime.prototype.withCalendar
  • Temporal.PlainDateTime.prototype.add
  • Temporal.PlainDateTime.prototype.subtract
  • Temporal.PlainDateTime.prototype.until
  • Temporal.PlainDateTime.prototype.since
  • Temporal.PlainDateTime.prototype.round
  • Temporal.PlainDateTime.prototype.equals
  • Temporal.PlainDateTime.prototype.toString
  • Temporal.PlainDateTime.prototype.toLocaleString
  • Temporal.PlainDateTime.prototype.toJSON
  • Temporal.PlainDateTime.prototype.valueOf
  • Temporal.PlainDateTime.prototype.toZonedDateTime
  • Temporal.PlainDateTime.prototype.toPlainDate
  • Temporal.PlainDateTime.prototype.toPlainYearMonth
  • Temporal.PlainDateTime.prototype.toPlainMonthDay
  • Temporal.PlainDateTime.prototype.toPlainTime
  • Temporal.PlainDateTime.prototype.getISOFields (reviewed @ptomato 2022-08-03)
  • Temporal.ZonedDateTime
  • Temporal.ZonedDateTime.from
  • Temporal.ZonedDateTime.compare
  • Temporal.ZonedDateTime.prototype.constructor (reviewed @ptomato 2022-08-03)
  • Temporal.ZonedDateTime.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.ZonedDateTime.prototype.calendar
  • Temporal.ZonedDateTime.prototype.timeZone
  • Temporal.ZonedDateTime.prototype.year
  • Temporal.ZonedDateTime.prototype.month
  • Temporal.ZonedDateTime.prototype.monthCode
  • Temporal.ZonedDateTime.prototype.day
  • Temporal.ZonedDateTime.prototype.hour
  • Temporal.ZonedDateTime.prototype.minute
  • Temporal.ZonedDateTime.prototype.second
  • Temporal.ZonedDateTime.prototype.millisecond
  • Temporal.ZonedDateTime.prototype.microsecond
  • Temporal.ZonedDateTime.prototype.nanosecond
  • Temporal.ZonedDateTime.prototype.epochSeconds
  • Temporal.ZonedDateTime.prototype.epochMilliseconds
  • Temporal.ZonedDateTime.prototype.epochMicroseconds
  • Temporal.ZonedDateTime.prototype.epochNanoseconds
  • Temporal.ZonedDateTime.prototype.dayOfWeek
  • Temporal.ZonedDateTime.prototype.dayOfYear
  • Temporal.ZonedDateTime.prototype.weekOfYear
  • Temporal.ZonedDateTime.prototype.hoursInDay
  • Temporal.ZonedDateTime.prototype.daysInWeek
  • Temporal.ZonedDateTime.prototype.daysInMonth
  • Temporal.ZonedDateTime.prototype.daysInYear
  • Temporal.ZonedDateTime.prototype.monthsInYear
  • Temporal.ZonedDateTime.prototype.inLeapYear
  • Temporal.ZonedDateTime.prototype.offsetNanoseconds
  • Temporal.ZonedDateTime.prototype.offset
  • Temporal.ZonedDateTime.prototype.with
  • Temporal.ZonedDateTime.prototype.withPlainTime
  • Temporal.ZonedDateTime.prototype.withPlainDate
  • Temporal.ZonedDateTime.prototype.withTimeZone
  • Temporal.ZonedDateTime.prototype.withCalendar
  • Temporal.ZonedDateTime.prototype.add
  • Temporal.ZonedDateTime.prototype.subtract
  • Temporal.ZonedDateTime.prototype.until
  • Temporal.ZonedDateTime.prototype.since
  • Temporal.ZonedDateTime.prototype.round
  • Temporal.ZonedDateTime.prototype.equals
  • Temporal.ZonedDateTime.prototype.toString
  • Temporal.ZonedDateTime.prototype.toLocaleString
  • Temporal.ZonedDateTime.prototype.toJSON
  • Temporal.ZonedDateTime.prototype.valueOf
  • Temporal.ZonedDateTime.prototype.startOfDay
  • Temporal.ZonedDateTime.prototype.toInstant
  • Temporal.ZonedDateTime.prototype.toPlainDate
  • Temporal.ZonedDateTime.prototype.toPlainTime
  • Temporal.ZonedDateTime.prototype.toPlainDateTime
  • Temporal.ZonedDateTime.prototype.toPlainYearMonth
  • Temporal.ZonedDateTime.prototype.toPlainMonthDay
  • Temporal.ZonedDateTime.prototype.getISOFields
  • Temporal.Duration
  • Temporal.Duration.from
  • Temporal.Duration.compare
  • Temporal.Duration.prototype.constructor (reviewed @ptomato 2022-08-03)
  • Temporal.Duration.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.Duration.prototype.years
  • Temporal.Duration.prototype.months
  • Temporal.Duration.prototype.weeks
  • Temporal.Duration.prototype.days
  • Temporal.Duration.prototype.hours
  • Temporal.Duration.prototype.minutes
  • Temporal.Duration.prototype.seconds
  • Temporal.Duration.prototype.milliseconds
  • Temporal.Duration.prototype.microseconds
  • Temporal.Duration.prototype.nanoseconds
  • Temporal.Duration.prototype.sign
  • Temporal.Duration.prototype.blank
  • Temporal.Duration.prototype.with
  • Temporal.Duration.prototype.negated
  • Temporal.Duration.prototype.abs
  • Temporal.Duration.prototype.add
  • Temporal.Duration.prototype.subtract
  • Temporal.Duration.prototype.round
  • Temporal.Duration.prototype.total
  • Temporal.Duration.prototype.toString
  • Temporal.Duration.prototype.toJSON
  • Temporal.Duration.prototype.toLocaleString
  • Temporal.Duration.prototype.valueOf
  • Temporal.Instant
  • Temporal.Instant.from
  • Temporal.Instant.fromEpochSeconds
  • Temporal.Instant.fromEpochMilliseconds
  • Temporal.Instant.fromEpochMicroseconds
  • Temporal.Instant.fromEpochNanoseconds
  • Temporal.Instant.compare
  • Temporal.Instant.prototype.constructor (reviewed @ptomato 2022-08-03)
  • Temporal.Instant.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.Instant.prototype.epochSeconds
  • Temporal.Instant.prototype.epochMilliseconds
  • Temporal.Instant.prototype.epochMicroseconds
  • Temporal.Instant.prototype.epochNanoseconds
  • Temporal.Instant.prototype.add
  • Temporal.Instant.prototype.subtract
  • Temporal.Instant.prototype.until
  • Temporal.Instant.prototype.since
  • Temporal.Instant.prototype.round
  • Temporal.Instant.prototype.equals
  • Temporal.Instant.prototype.toString
  • Temporal.Instant.prototype.toLocaleString
  • Temporal.Instant.prototype.toJSON
  • Temporal.Instant.prototype.valueOf
  • Temporal.Instant.prototype.toZonedDateTime
  • Temporal.Instant.prototype.toZonedDateTimeISO
  • Temporal.PlainYearMonth
  • Temporal.PlainYearMonth.from
  • Temporal.PlainYearMonth.compare
  • Temporal.PlainYearMonth.prototype.constructor (reviewed @ptomato 2022-08-03)
  • Temporal.PlainYearMonth.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainYearMonth.prototype.calendar
  • Temporal.PlainYearMonth.prototype.year
  • Temporal.PlainYearMonth.prototype.month
  • Temporal.PlainYearMonth.prototype.monthCode
  • Temporal.PlainYearMonth.prototype.daysInYear
  • Temporal.PlainYearMonth.prototype.daysInMonth
  • Temporal.PlainYearMonth.prototype.monthsInYear
  • Temporal.PlainYearMonth.prototype.inLeapYear
  • Temporal.PlainYearMonth.prototype.with
  • Temporal.PlainYearMonth.prototype.add
  • Temporal.PlainYearMonth.prototype.subtract
  • Temporal.PlainYearMonth.prototype.until
  • Temporal.PlainYearMonth.prototype.since
  • Temporal.PlainYearMonth.prototype.equals
  • Temporal.PlainYearMonth.prototype.toString
  • Temporal.PlainYearMonth.prototype.toLocaleString
  • Temporal.PlainYearMonth.prototype.toJSON
  • Temporal.PlainYearMonth.prototype.valueOf
  • Temporal.PlainYearMonth.prototype.toPlainDate
  • Temporal.PlainYearMonth.prototype.getISOFields (reviewed @ptomato 2022-08-03)
  • Temporal.PlainMonthDay
  • Temporal.PlainMonthDay.from
  • Temporal.PlainMonthDay.prototype.constructor (reviewed @ptomato 2022-08-03)
  • Temporal.PlainMonthDay.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.PlainMonthDay.prototype.calendar
  • Temporal.PlainMonthDay.prototype.monthCode
  • Temporal.PlainMonthDay.prototype.day
  • Temporal.PlainMonthDay.prototype.with
  • Temporal.PlainMonthDay.prototype.equals
  • Temporal.PlainMonthDay.prototype.toString
  • Temporal.PlainMonthDay.prototype.toLocaleString
  • Temporal.PlainMonthDay.prototype.toJSON
  • Temporal.PlainMonthDay.prototype.valueOf
  • Temporal.PlainMonthDay.prototype.toPlainDate
  • Temporal.PlainMonthDay.prototype.getISOFields (reviewed @ptomato 2022-08-03)
  • Temporal.TimeZone
  • Temporal.TimeZone.from
  • Temporal.TimeZone.prototype.constructor (reviewed @ptomato 2022-08-03)
  • Temporal.TimeZone.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.TimeZone.prototype.id
  • Temporal.TimeZone.prototype.getOffsetNanosecondsFor
  • Temporal.TimeZone.prototype.getOffsetStringFor
  • Temporal.TimeZone.prototype.getPlainDateTimeFor
  • Temporal.TimeZone.prototype.getInstantFor
  • Temporal.TimeZone.prototype.getPossibleInstantsFor
  • Temporal.TimeZone.prototype.getNextTransition
  • Temporal.TimeZone.prototype.getPreviousTransition
  • Temporal.TimeZone.prototype.toString
  • Temporal.TimeZone.prototype.toJSON
  • Temporal.Calendar
  • Temporal.Calendar.from
  • Temporal.Calendar.prototype.constructor (reviewed @ptomato 2022-08-03)
  • Temporal.Calendar.prototype[ @@toStringTag ] (reviewed @Ms2ger 2022-05-19)
  • Temporal.Calendar.prototype.id
  • Temporal.Calendar.prototype.dateFromFields
  • Temporal.Calendar.prototype.yearMonthFromFields
  • Temporal.Calendar.prototype.monthDayFromFields
  • Temporal.Calendar.prototype.dateAdd
  • Temporal.Calendar.prototype.dateUntil
  • Temporal.Calendar.prototype.year
  • Temporal.Calendar.prototype.month
  • Temporal.Calendar.prototype.monthCode
  • Temporal.Calendar.prototype.day
  • Temporal.Calendar.prototype.dayOfWeek
  • Temporal.Calendar.prototype.dayOfYear
  • Temporal.Calendar.prototype.weekOfYear
  • Temporal.Calendar.prototype.daysInWeek
  • Temporal.Calendar.prototype.daysInMonth
  • Temporal.Calendar.prototype.daysInYear
  • Temporal.Calendar.prototype.monthsInYear
  • Temporal.Calendar.prototype.inLeapYear
  • Temporal.Calendar.prototype.fields
  • Temporal.Calendar.prototype.mergeFields
  • Temporal.Calendar.prototype.toString
  • Temporal.Calendar.prototype.toJSON
  • Temporal.Calendar.prototype.era
  • Temporal.Calendar.prototype.eraYear
  • Temporal.PlainDate.prototype.era
  • Temporal.PlainDate.prototype.eraYear
  • Temporal.PlainDateTime.prototype.era
  • Temporal.PlainDateTime.prototype.eraYear
  • Temporal.PlainYearMonth.prototype.era
  • Temporal.PlainYearMonth.prototype.eraYear
  • Temporal.ZonedDateTime.prototype.era
  • Temporal.ZonedDateTime.prototype.eraYear"
(generated via the following script)
Array.from(document.querySelectorAll('[id^="sec-temporal."], [id^="sec-get-temporal."]'))
  .map((el) => {
    return el
      .querySelector('h1')
      .innerText
      .replace(/^[0-9\. ]*(?:get )?([^ ([]+)(\[[^\]]+])?.*/, '- [ ] $1$2');
  })
  .join('\n');

I executed that in the browser's Developer Console on the proposal's specification text.

Notes about specific things that should have test coverage:

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions