Closed
Description
When matching on textContent
, a lot of the time, there will be extra whitespace/newlines surrounding the text you're matching based on how the HTML looks within the element you're matching. It could be nice to strip all of the redundant whitespace out when doing the comparison within this library as well such that consumers of it don't need to account for that whitespace in their comparison strings.
For example, a textContent
of
' white
space '
could be stripped to just
'white space'
to allow matching by passing just 'white space'
without needing wildcards in the comparison string. This could vastly improve test cases asserting that text exists. This could also perhaps be configurable too in case someone actually needed the textContent
as-is in the HTML.