Description
Sometimes when I issue .contains() commands with text I expect to be found, it doesn't match my element as expected due to extra whitespace/new lines in my element.
Code
HTML
Test
cy.contains("hello world")
// CypressError: Timed out retrying: Expected to find content: 'hello world' but never did.
Web Page

Additional Info
Checking jQuery's .text() in console, I see there is whitespace leading/trailing the actual text.
> $("h1").text()
> "hello
world"
Could it be possible to remove whitespace/new lines of el's when trying to match with .contains?
Description
Sometimes when I issue
.contains()commands with text I expect to be found, it doesn't match my element as expected due to extra whitespace/new lines in my element.Code
HTML
Test
Web Page
Additional Info
Checking jQuery's
.text()in console, I see there is whitespace leading/trailing the actual text.Could it be possible to remove whitespace/new lines of el's when trying to match with
.contains?