add excludeHidden for *ByText queries#1184
add excludeHidden for *ByText queries#1184rluvaton wants to merge 2 commits intotesting-library:mainfrom
excludeHidden for *ByText queries#1184Conversation
|
Before I start adding tests, what do you think about this? Cc @kentcdodds
|
|
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 c546d52:
|
|
Honestly, I think this would be a worthwhile thing in all the queries and eventually should be enabled by default (which of course would be a breaking change). |
eps1lon
left a comment
There was a problem hiding this comment.
Why not use the same name for the option as ByRole does?
Also note that this has considerable perf impact. ByText etc are a faster, less accurate helper and with this change we're making the distinction between By* and ByRole less clear.
|
I think that's fair @eps1lon. As I'm no longer maintaining Testing Library, I don't think it's fair for me to make decisions here. I think the best would be to have this supported in all the queries and the "faster, less accurate helper" can be offered by using the option. |
|
I'm not fundamentally opposed. But the added dimension due to the naming of the option is a bigger concern for me right now. |
|
Oh, yeah, I agree we should probably keep the names consistent 👍 |
|
I used different name to avoid confusion with |
What: add
excludeHiddenoption for*ByTextqueriesWhy: #196
How: used the already existing
isInaccessiblefunctionChecklist:
docs site