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
How about the waitForNextUpdate function ? Im trying to figured out how to upgrade my tests to be compatible with the new renderHook on the react-testing-library
@manugo-dev you should be able to use react-native-testing-library's waitfor instead. If I'm correct, being able to use the async utils from the library instead of utils such as waitForNextUpdate that are a bit too focused on implementation detailswas one of the reasons why it was decided to implement a renderHook equivalent on react-native-testing-library and on react-testing-library's side
@manugo-dev you should be able to use react-native-testing-library's waitfor instead. If I'm correct, being able to use the async utils from the library instead of utils such as waitForNextUpdate that are a bit too focused on implementation detailswas one of the reasons why it was decided to implement a renderHook equivalent on react-native-testing-library and on react-testing-library's side
Am I correct in assuming that what you mean is there's no built in way to waitFor the return values of hooks directly anymore and we will need to always test the consumers of the hooks and have to waitFor elements to show/hide based on the values of the hook?
Edit: ignore this comment, moving discussions over to #1030
Yes that's how the other libraries typically work with waitFor, but that's not the functionality I'm seeing with RNTL. I opened a separate issue here that I'm going to be looking more into
Activity
MattAgn commentedon Dec 7, 2021
Hi @thymikee! I'd be glad to help on this, I'll make a PR shortly
pierrezimmermannbam commentedon Feb 22, 2022
Hi @thymikee, @MattAgn told me he finally couldn't find time for this so I made a pr
manugo-dev commentedon Apr 20, 2022
Hello there!
How about the waitForNextUpdate function ? Im trying to figured out how to upgrade my tests to be compatible with the new renderHook on the react-testing-library
pierrezimmermannbam commentedon Apr 21, 2022
@manugo-dev you should be able to use react-native-testing-library's waitfor instead. If I'm correct, being able to use the async utils from the library instead of utils such as waitForNextUpdate that are a bit too focused on implementation detailswas one of the reasons why it was decided to implement a renderHook equivalent on react-native-testing-library and on react-testing-library's side
mdjastrzebski commentedon Jun 2, 2022
Closing as implemented by #963.
kylebake commentedon Aug 1, 2022
Am I correct in assuming that what you mean is there's no built in way to
waitForthe return values of hooks directly anymore and we will need to always test the consumers of the hooks and have towaitForelements to show/hide based on the values of the hook?Edit: ignore this comment, moving discussions over to #1030
AugustinLF commentedon Aug 2, 2022
I believe what they mean is that you can simply use
waitForto wait for the value of the hook to change. Something like that:kylebake commentedon Aug 2, 2022
Yes that's how the other libraries typically work with waitFor, but that's not the functionality I'm seeing with RNTL. I opened a separate issue here that I'm going to be looking more into