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
{{ message }}
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.
If one wishes to test for deep equality (i.e. recursive equality), one currently has to supply their own deep equality function and write something like expect(deepEqual(value1, value2)).to.equal(true)
An option to test for deep equality between two tables, especially one that can alert where the two tables differ if they do, would be very helpful.
The text was updated successfully, but these errors were encountered:
For using a custom deepEqual function, I'd highly recommend using assert instead of expect, since it lets you have a custom error message that can be returned by your comparison function.
I'm hesitant to add more assertion features into TestEZ's expectation library, especially as they become a little more opinionated. Deep equality is a good example of something that can vary based on intent; it isn't applicable to things like Roact objects, and falls apart for cases where we use tables for their identity on purpose!
If anything, I'd like to start moving towards making it easier to make TestEZ itself smaller, and introduce libraries to fix opinionated cases like this one.
That's fair. There is the option to parameterize the deepEqual function to allow for variety in how it should be used (e.g. for metatables, self references, maximal recursion depths etc), but I can see how that might make the framework less lightweight.
If one wishes to test for deep equality (i.e. recursive equality), one currently has to supply their own deep equality function and write something like
expect(deepEqual(value1, value2)).to.equal(true)
An option to test for deep equality between two tables, especially one that can alert where the two tables differ if they do, would be very helpful.
The text was updated successfully, but these errors were encountered: