feat: allow text matching with a regex#41
Merged
lexanth merged 4 commits intolexanth:masterfrom May 18, 2025
Merged
Conversation
dc1fb79 to
665396d
Compare
pagevault-michael
approved these changes
Apr 29, 2024
Contributor
Author
|
@lexanth , @pagevault-michael , any feedback on merging this? ;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@lexanth , thank you a lot for your reply to #31 (comment)
This PR aims to address the following point mentioned by #31 (comment):
I did so by allowing the caller of the methods to specify a regex to match against the HTML text content.
As much as I'd like to address the other points as well, this would be my first contribution to the package, so I've aimed to make this PR as simple as possible.
By the way, about the normalisation: I still didn't implement the possibility of overriding the default normaliser, described by https://testing-library.com/docs/queries/about/#normalization, which reads:
That's because IMHO, this behaviour will already fits the vast majority of use cases. Please do let me know if you think differently, and I'll adjust this PR!
Thank you! 🚀