You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love what you've done polyfilling Temporal - I'm working on a new project and have no desire to keep using Dates for it. However I have encountered an odd bug when checking equality of arrays of Temporal objects (recreated in the attached test) which has shaken my confidence a bit...
If I do straight equality checks for two PlainDates, or PlainTimes, or ZonedDateTimes then it all works as expected - if A and B are equal then vitest's expect(a).toEqual(b) passes, if they are different it fails.
However if instead I run expect([a,b]).toEqual([b,a]) it always passes, regardless of whether a and b are the same or different. Not ideal!
Hi,
I love what you've done polyfilling Temporal - I'm working on a new project and have no desire to keep using Dates for it. However I have encountered an odd bug when checking equality of arrays of Temporal objects (recreated in the attached test) which has shaken my confidence a bit...
If I do straight equality checks for two
PlainDate
s, orPlainTime
s, orZonedDateTime
s then it all works as expected - if A and B are equal then vitest'sexpect(a).toEqual(b)
passes, if they are different it fails.However if instead I run
expect([a,b]).toEqual([b,a])
it always passes, regardless of whethera
andb
are the same or different. Not ideal!temporal.test.txt
This is on node 23.5.0, vitest 3.1.1, temporal 0.30.0, typescript 5.8.2.
Any ideas? I'm not sure if the problem sits inside the library, vitest or somewhere in-between but it certainly isn't the outcome I'd expect!
Thanks,
Tom
The text was updated successfully, but these errors were encountered: