-
Notifications
You must be signed in to change notification settings - Fork 6
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 weird output :) #295
Fix weird output :) #295
Conversation
Improves the output in a number of cases and fixes #294
Hmm, this is causing one of the examples in the documentation to fail differently: diff --git a/documentation/assertions/DOMNodeList/to-contain.md b/documentation/assertions/DOMNodeList/to-contain.md
index 3351913..f471c71 100644
--- a/documentation/assertions/DOMNodeList/to-contain.md
+++ b/documentation/assertions/DOMNodeList/to-contain.md
@@ -25,49 +25,54 @@ expect(element, 'to contain', { name: 'li', textContent: /One|Two|Tree/ });
In case of a failing expectation you get the following output:
```diff
expect(
element,
'queried for',
'li',
'to contain',
'<li class="count">Three</li>'
);
```
```output
expected
<section>
<h1>Numbers</h1>
<hr>
<ol data-test-id="numbers">
<li class="number">...</li>
<li class="number">...</li>
<li class="number">...</li>
</ol>
</section>
queried for li to contain '<li class="count">Three</li>'
expected
NodeList[
<li class="number">One</li>,
<li class="number">Two</li>,
<li class="number">Three</li>
]
to contain <li class="count">Three</li>
<li
class="number" // expected [ 'number' ] to contain 'count'
- >Three</li>
+ >
+ One // should equal Three
+ //
+ // -One
+ // +Three
+ </li>
``` Seems like it's now considering the match against the |
…lements in children arrays
Figured out that |
Pull Request Test Coverage Report for Build 1233
💛 - Coveralls |
@papandreou minor comment about the test but this looks like a nice fix. |
Yeah, I agree, I had forgotten that we had those helpers 😅 Fixed in 1aeca8b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is beautiful 💯
@papandreou I think the |
Just for the duration of each outer findMatchesWithGoodScore call #295 (comment)
Hmm, unfortunately that re-uglifies some of the diffs for |
@papandreou the problem with |
But the current PR doesn't look like it will make that situation a lot worse. |
You mean with or without the memoization? 🤔 |
@sunesimonsen, I'll merge it as-is, we can just revert the memoization if that's what you meant. It's not exactly pretty :) |
Released in 4.14.2. |
Fixes #294