Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Ignore bug #211

Merged
merged 4 commits into from
Sep 23, 2018
Merged

Fix: Ignore bug #211

merged 4 commits into from
Sep 23, 2018

Conversation

sunesimonsen
Copy link
Member

@sunesimonsen sunesimonsen commented Sep 22, 2018

Fixes: #212

Reproduces a bug where the user is trying to ignore a text node in to satisfy and fixes it.

@coveralls
Copy link

coveralls commented Sep 22, 2018

Pull Request Test Coverage Report for Build 788

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 91.379%

Totals Coverage Status
Change from base Build 784: 0.0%
Covered Lines: 504
Relevant Lines: 533

💛 - Coveralls

@sunesimonsen sunesimonsen changed the title Ignore bug Fix: Ignore bug Sep 22, 2018
@alexjeffburke
Copy link
Member

Interesting and good catch I'd say!

Just for my understanding, does this come from text nodes being compared as plain strings and thus we end up comparing a text node to an empty object that fails in "to satisfy" when recursing?

@sunesimonsen
Copy link
Member Author

sunesimonsen commented Sep 22, 2018

The problem is that the RHS is converted into a to satisfy object structure. That would mean we would end up comparing a string to the empty object.

screen shot 2018-09-22 at 21 53 24

Copy link
Member

@papandreou papandreou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! I guess expect.it('to be a', 'DOMNode') would also have worked, as all the unexpected-dom types except DOMNodeList inherit from that. Still, there's certainly no harm in using any, and "to be an any" sounds funny :)

@sunesimonsen
Copy link
Member Author

Great catch! I guess expect.it('to be a', 'DOMNode') would also have worked, as all the unexpected-dom types except DOMNodeList inherit from that. Still, there's certainly no harm in using any, and "to be an any" sounds funny :)

Good point. I think that would actually be better and more precise.

@sunesimonsen sunesimonsen merged commit f8fdaaa into master Sep 23, 2018
@sunesimonsen sunesimonsen deleted the ssimonsen/ignore-bug branch September 23, 2018 08:08
@sunesimonsen
Copy link
Member Author

Released as unexpected-dom@4.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignoring text nodes doesn't work
4 participants