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.
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 |
- 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