-
Notifications
You must be signed in to change notification settings - Fork 405
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
toContainHTML no explanation for error message #299
Comments
I would like to work on this |
@kiranjd thanks, you are very welcome. Go for it! |
kiranjd
added a commit
to kiranjd/jest-dom
that referenced
this issue
Dec 19, 2020
4 tasks
gnapse
added a commit
that referenced
this issue
Dec 30, 2020
🎉 This issue has been resolved in version 5.11.8 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This was referenced Mar 7, 2021
This was referenced Mar 14, 2021
chore(dep-bot): bump @testing-library/jest-dom from 5.11.4 to 5.11.9
RomainCoudour/react-side-pane#1
Closed
Merged
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After receiving HTML from a function, toContainHTML will throw an error without any explanation. No 'expected', terminal will only show what it received.
Jest test:
expect(getElement('paragraph', 'footer')).toContainHTML('<p class="paragraph second-paragraph" id="id7">this is the second paragraph of footer</p>');
Terminal log:
Received: <p class="paragraph second-paragraph" id="id7">this is the second paragraph of footer</p>
If I use toContainElement, it will throw an error that it receives a string and not an HTML element.
The getElement function will return the HTML element as soon as they find a match with the classes ("class="paragraph second-paragraph")
The text was updated successfully, but these errors were encountered: