-
Notifications
You must be signed in to change notification settings - Fork 273
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
feat: add renderHook function #923
feat: add renderHook function #923
Conversation
The |
The RTL PR has been merged now. Please let me know if there is anything I can do to progress this. |
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.
Implementation and tests look correct to me. Could you fix the conflicts and also add documentation for it please?
https://github.com/callstack/react-native-testing-library/blob/main/website/docs/API.md
After that I think we should be able to get that in!
8153480
to
01b9468
Compare
I'm working on migrating to typescript, I'll add documentation afterwards, it shouldn't take long |
01b9468
to
403ca97
Compare
403ca97
to
2331b51
Compare
It's done, there is a typing issue because the option param is optional so initialProps may not be defined when it needs to be but changing the typing would mean having a different api from the one of react-hooks-testing-library and I'm not sure it's something we want. I also added documentation, I used the documentation I found on the react-hooks-testing-library repo and added some examples |
Oops forgot to ask for flow types https://github.com/callstack/react-native-testing-library/blob/main/typings/index.flow.js But after that we should be good I believe |
@AugustinLF I added the flow types |
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.
Pushed some documentation updates. Looks pretty!
- feat: add renderHook function(callstack/react-native-testing-library#923)
Summary
This pr provides a basic implementation of renderHook as requested in #869. The solution is almost a copy past from the one made in react testing library
Test plan
Some test cases were added, also inspired from the implementation from react testing library