-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Refactor custom matchers (closes #45) #46
Conversation
Thanks for this!
There are only 3 custom matchers, with few common utils like
What if someone does this:
then we decided to throw exception like:
And also I guess you had to add |
Agree that it might not be a good idea to split the custom matchers. That's why I did not do it, just wanted to throw the idea out there. What do you think about exporting each of them individually as named exports? Not that's too important right now, but I find it odd to have them all bundled in an object, when they are independent pieces. About this
The whole point of Regarding the
|
Ok, sorry about the rushed response. I fully get what you mean now. I added the check for html elements in I was confused at first because this check was never there before, just a superfluous call to |
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 5 5
Lines 98 92 -6
Branches 22 24 +2
=====================================
- Hits 98 92 -6
Continue to review full report at Codecov.
|
May be we can take this up. @kentcdodds Any thoughts?
Yes, but since we have checks like:
What if the |
Could we move this over to dom-testing-library? Sorry to change things underneath you! |
No problem, it makes sense. I'll re-create the PR over there. |
This is a proposed refactor to the custom matchers code, as briefly discussed in #44 (comment):
Closes #45
Proposed changes not yet performed (pending discussion)
Pending to be fixed
getDisplayName
never gets called during the tests with a class as argument, only with html elements. I wonder if that is expected, given that this library is only dealing with rendered html and not the virtual dom, or is it?