Open kopax opened 4 years ago
I am building a react-native application with expo SDK36.
I am having error when using AsyncStorage, it seems that the whole tree is not rendered entirely yet because of the loading asynchronous.
AsyncStorage
tree
loading
Adding, the following line after the render solve the issue.
render
await new Promise(resolve => setTimeout(resolve, 1));
How should I test with jest and AsyncStorage properly?
Thanks and best!
I solved this problem by using the mock provided by the library. https://react-native-async-storage.github.io/async-storage/docs/advanced/jest#using-async-storage-mock
I am building a react-native application with expo SDK36.
I am having error when using
AsyncStorage
, it seems that the wholetree
is not rendered entirely yet because of theloading
asynchronous.Adding, the following line after the
render
solve the issue.How should I test with jest and
AsyncStorage
properly?Thanks and best!
Versions