-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Pretty-printing jsdom objects is way too verbose #2146
Comments
@yaycmyk are you interested in making such plugin for |
I'm pretty in the weeds on a personal project, so I can't commit the time
right now. Someone else can take over my work though!
|
Thanks! Marking this as a Good First Task then, since majority of the work is done by you. |
I'd like to pick this up (assuming it's still valid/desired). |
Go for it! Check out the pretty-format package in the Jest repo and how the plugin system works. |
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. |
This is what I see with a single failing expectation:
This is because jsdom has its implementation under a
Symbol()
key, and a single jsdom element brings the whole jsdom with it.Can we fix it by adding some sort of pretty-printing for jsdom? I know that's what @yaycmyk attempted in jamiebuilds/pretty-format#47 but it received a comment:
Shall we do this them?
Another way to fix this specific issue would be to skip
Symbol()
keys since they're intentionally "private". The downside would be that comparing two objects with different values under Symbol keys would presumably miss those differences. We could maybe only printSymbol()
keys if we know the difference is inside of them but skip them otherwise.Yet another way to fix it would be to limit nesting when printing difference to something like 3. I think it's what Node does in console.log but I might be wrong.
The text was updated successfully, but these errors were encountered: