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
I try use package uuid and react native get random values to create random uuid. Everything is fine and working. But when I try run my test file using jest, and I get an error Cannot read property 'getRandomBase64' of undefined.
How to solve this error?
Thanks.
The text was updated successfully, but these errors were encountered:
I was having this problem as well while using jest to test my Entrypoint file.
My Entrypoint had the following for import Expo SDK@39.0.3 to support calling UUID@8.3.1:
import'react-native-get-random-values';
Because my Entrypoint file was trying to import the react-native-get-random-values for shallow rendering, it was throwing the Cannot read property 'getRandomBase64' of undefined error when getting tested since it wasn't being set up correctly during the test.
I ended up solving this by mocking out the function call for getRandomBase64 in my Entrypoint test file like this:
I try use package uuid and react native get random values to create random uuid. Everything is fine and working. But when I try run my test file using jest, and I get an error Cannot read property 'getRandomBase64' of undefined.
How to solve this error?
Thanks.
The text was updated successfully, but these errors were encountered: