Async testing React Navigation 5 in Jest: NavigationContainer causes console error
My recommendation after calling render
from react-native-testing-library
for components that do async work, useEffect
(acting as componentDidMount
), changing state, etc:
await act(async () => {})
Or even:
await act(async () => await flushMicrotasksQueue())
If you have some timeouts around.