chai-jquery
chai-jquery copied to clipboard
Fix method `text` to work with other types then strings
For the following HTML structure:
<div id="el">123</div>
Such formulated expectation, when called with a number and not a string, will fail because of strict comparison ===
expect($('#el')).to.have.text(123)
My fix ensures that any param for the text()
method is converted into a string before comparing it with element text.
@keithamus and @meeber what you think?