chai-jquery icon indicating copy to clipboard operation
chai-jquery copied to clipboard

Fix method `text` to work with other types then strings

Open pkuczynski opened this issue 4 years ago • 1 comments

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.

pkuczynski avatar Nov 13 '19 09:11 pkuczynski

@keithamus and @meeber what you think?

pkuczynski avatar Nov 13 '19 09:11 pkuczynski