-
Notifications
You must be signed in to change notification settings - Fork 470
Lists elements that matched multiple error #678
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
Lists elements that matched multiple error #678
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit ca6ceb3:
|
Codecov Report
@@ Coverage Diff @@
## master #678 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 602 603 +1
Branches 151 151
=========================================
+ Hits 602 603 +1
Continue to review full report at Codecov.
|
I definitely feel like this would improve the error message. I'd love to find a way to do it that is backwards compatible. We can improve the API in the next major version bump. |
I think ideally it belongs in the I've pushed that change (no longer breaking) and an accompanying test |
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.
Love it 👍
I think your other PR triggered merge conflicts. Could you fix those please? |
Wow git really mangled those together All resolved now 🙏 |
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.
Awesome 👍
Thanks so much for your help! I've added you as a collaborator on the project. Please make sure that you review the |
🎉 This PR is included in version 7.19.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What:
This PR adds the found elements to the log output of the MultipleError
Current error
New error
Why:
It's not always immediately obvious which elements are conflicting, and since dom-testing-library needs to find them in order to know there are multiples it makes sense to expose that to the user
How:
I'm quite certain this is not the correct implementation of this feature, but I wanted to trial it out before investing too much time. If it's something deemed worthy of inclusion, I'd appreciate a little guidance on how to structure this (possibly a new wrapQuery type function) in a way that's idiomatic to the codebase
Checklist:
docs site N/A