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")
I would like to work on this
@kiranjd thanks, you are very welcome. Go for it!
:tada: This issue has been resolved in version 5.11.8 :tada:
The release is available on:
npm package (@latest dist-tag)Your semantic-release bot :package::rocket: