You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, thank you to all the maintainers and contributors who have worked on this - this package makes testing Preact apps so much easier!
I was just wondering if there's there any reason why a component can't be used as a selector for the render context's find method? (find(Selector) or find(ImportedComponent), for example.)
The documentation and types added in #78 only cover nodes, but as far as I can tell this already works: selToWhere(Selector) returns { nodeName: Selector }, and isWhere already handles nodeName values that are functions.
This would make testing in TypeScript easier, as creating a JSX selector without the required props causes type errors, while including the required props can make the test overly specific.
Happy to open a PR to add tests and update the types if that's all that's required.
The text was updated successfully, but these errors were encountered:
Firstly, thank you to all the maintainers and contributors who have worked on this - this package makes testing Preact apps so much easier!
I was just wondering if there's there any reason why a component can't be used as a selector for the render context's
find
method? (find(Selector)
orfind(ImportedComponent)
, for example.)The documentation and types added in #78 only cover nodes, but as far as I can tell this already works:
selToWhere(Selector)
returns{ nodeName: Selector }
, andisWhere
already handlesnodeName
values that are functions.This would make testing in TypeScript easier, as creating a JSX selector without the required props causes type errors, while including the required props can make the test overly specific.
Happy to open a PR to add tests and update the types if that's all that's required.
The text was updated successfully, but these errors were encountered: