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
When Jest diffs entities for like expect(result).toEqual(someEntity), it deep crawls into each entity and ends up diffing the entire EntityManager / connection pool / etc.
Besides just being slow, if the assertions ever fail, the diff output is huge.
We've added toMatchEntity to work around the inability to custom toEquals diff output, but it's easy to forget to use it.
We could probably add a custom equality matcher, see here:
When Jest diffs entities for like
expect(result).toEqual(someEntity)
, it deep crawls into each entity and ends up diffing the entireEntityManager
/ connection pool / etc.Besides just being slow, if the assertions ever fail, the diff output is huge.
We've added
toMatchEntity
to work around the inability to customtoEqual
s diff output, but it's easy to forget to use it.We could probably add a custom equality matcher, see here:
https://github.com/jestjs/jest/blob/9113f44b459f96db31e5ad3811d4d8b07f79e54f/packages/expect-utils/src/jasmineUtils.ts#L79
That doesn't actually provide custom equality, but instead just tells the user to use
toMatchEntity
instead.The text was updated successfully, but these errors were encountered: