Testing- TypeError: Cannot read property 'DocumentDir' of undefined
Closed this issue · 3 comments
I am running jest unit tests, and I get the following error:
Test suite failed to run
TypeError: Cannot read property 'DocumentDir' of undefined
at Object.<anonymous> (node_modules/react-native-fetch-blob/fs.js:24:24)
at Object.<anonymous> (node_modules/react-native-fetch-blob/index.js:21:9)
I went through all the previous similar issues but couldn't find a way to get rid of this error. The library is linked correctly and the app is functioning normally.
Is there any strategy you guys suggest for testing? Maybe updating the readMe could be helpful.
For reference:
RNProject: https://github.com/Sam1301/zulip-mobile/tree/fetch-blob-test
version: 0.10.5
Thanks.
Hello i have solved this issue---- when you install the react-native-fetch-blob and link with iOS, it only provide limited lib on native side.
you can to open project from iOS in Xcode then remove the library of RNFetchBlob.xcodeproj from library folder and then again add by right click on library folder from node modules-->react-native-fetch-blob--->iOS folder --->add project RNFetchBlob.xcodeproj then all required file will be there and make sure add lib on build phases also libRNFetchBlob.a
it works for me.
Thanks
Thanks for tracking this down :)
Today, i also got stuck on the same issue, this saved my time 😍