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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce output for custom objects when using toHaveLength matcher #6519
Comments
To be fair, you can opt out of this, and just |
A quick win might be to remove the
A slightly more complicated but better alternative could be to use |
@pedrottimark are you fixing this in your PR? |
@greypants thanks for this man, you are amazing |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
馃殌 Feature Proposal
Remove the received output for custom objects that fail a
toHaveLength
matcher assertion.Motivation
If you use
toHaveLength
on a custom object, like an enzyme Wrapper, the output logs all the properties of the object. This makes tests difficult to read.Example
The same way as before, but no received logging for objects that aren't an Array.
Pitch
Appropriate custom matchers make failing tests more expressive, but error messages for custom objects with
toHaveLength
are too verbose. It makes failing tests less expressive.The text was updated successfully, but these errors were encountered: