Skip to content
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

Remove dom node in error messages in cypress environment #157

Merged
merged 3 commits into from
Nov 21, 2018

Conversation

misoguy
Copy link
Contributor

@misoguy misoguy commented Nov 21, 2018

Resolves #156 and also resolves testing-library/cypress-testing-library#25

What: This PR removes the dom nodes being printed from the error message shown in cypress when a test fails to locate the specified dom node.

Why: Showing the whole dom in cypress clutters up the error log.

How: There was already a condition present to prevent printing out dom node in cypress but it is not valid in latest version of cypress which is why I added another condition to make this work.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

@misoguy misoguy changed the title Pr/156 Remove dom node in error messages in cypress environment Nov 21, 2018
Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to add a typeof check on global so this code can run in the browser.

@kentcdodds
Copy link
Member

Also, thanks!

@misoguy
Copy link
Contributor Author

misoguy commented Nov 21, 2018

@kentcdodds added the typeof check

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic 💯 Thanks!

@kentcdodds kentcdodds merged commit 0b6b9e3 into testing-library:master Nov 21, 2018
@kentcdodds
Copy link
Member

🎉 This PR is included in version 3.12.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message in cypress shows the whole DOM when an element is not found
2 participants