Creating a test for the CurrentLocation component makes the Travis build fail although it passes locally.
The error thrown is the following:
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
at Object.get AsyncStorage [as AsyncStorage] (node_modules/react-native/Libraries/react-native/react-native-implementation.js:179:12)
at Timeout._onTimeout (components/CurrentLocation.js:878:20)
/home/travis/build/mohanadarafe/GuideMe/components/CurrentLocation.js:878
_reactNative.AsyncStorage.setItem("altitude", altitude);
^
TypeError: _reactNative.AsyncStorage.setItem is not a function
at Timeout._onTimeout (/home/travis/build/mohanadarafe/GuideMe/components/CurrentLocation.js:33:26)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
To reproduce bug
Create a unit test for the CurrentLocation component (very basic, use the existing tests as a template)
Push your code on GitHub
Watch the build fail and throw the mentioned error
Creating a test for the CurrentLocation component makes the Travis build fail although it passes locally. The error thrown is the following:
To reproduce bug