Skip to content

Conversation

@ptomato
Copy link
Collaborator

@ptomato ptomato commented Oct 22, 2025

Similar to #3164, adds tests with many combinations of inputs for addition and subtraction on all Temporal types. Some deduplication of code into the support.mjs file, and a new list of "interesting" Durations.

This is a new test to exercise addition arithmetic of Durations to
PlainDates, with snapshotting. The "interesting" dates are the same as
in test/thorough/datedifference.mjs.

We add a new list of "interesting" durations for use in this and
following tests. They are annotated with comments explaining why they
are included.

Some improvements to the support file: refactor the creation of the
"interesting" dates into a makeDateCases() function, and also add a
facility to match a snapshot of the result of a function call that may
also legitimately throw a RangeError.
Similar to the previous commit, combining the "interesting" datetimes
from test/thorough/datetimedifference.mjs with the "interesting"
durations.
Similar to the previous commit, combining the "interesting" epoch
nanoseconds from test/thorough/instantdifference.mjs with the
"interesting" durations.
Similar to the previous commit, combining the "interesting" times from
test/thorough/timedifference.mjs with the "interesting" durations.
Similar to the previous commit, combining the "interesting" year-months
from test/thorough/yearmonthdifference.mjs with the "interesting"
durations.
Similar to the previous commit, combining the "interesting"
ZonedDateTimes from test/thorough/zoneddifference.mjs with the
"interesting" durations.
Combining the "interesting" durations with each other in addition and
subtraction. We need to filter out durations with calendar units for
this.
@ptomato ptomato requested a review from gibson042 October 22, 2025 17:49
@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.91%. Comparing base (c8571ae) to head (08b67f3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3170   +/-   ##
=======================================
  Coverage   96.91%   96.91%           
=======================================
  Files          22       22           
  Lines       10209    10209           
  Branches     1839     1839           
=======================================
  Hits         9894     9894           
  Misses        266      266           
  Partials       49       49           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant