-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: @effect/vitest custom testers #2646
feat: @effect/vitest custom testers #2646
Conversation
🦋 Changeset detectedLatest commit: 903c9e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
515456f
to
df94dca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it would be better to add a tester that checks for Equal.isEqual
and uses Equal.equals
if true.
df94dca
to
903c9e2
Compare
I'm exploring this option, the problem is the fallback on strict equality for objects not implementing |
Wondering if we can make equal act structurally for plain objects with a regional flag |
testing the idea here: #2662 |
While making the equals a little bit smarter by moving closer to the comparison by value absolutely feels like a good move, IMO we should still not break the equality logic of the vitest. Vitest (and I assume generally any testing lib) can have its own comparison logic and most importantly a mechanism for injecting a custom testers (users of Vitest can introduce their own equality for specific cases), therefore the best way to approach this seems to be to introduce an equality tester checking effect's data types "structurally" and than giving the control back to the equality logic of the testing lib for other nested values. |
The MVP of #2629