LinusU / LinusU/react-native-get-random-values
Error Cannot read property 'getRandomBase64' of undefined when running test file
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 415
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Description
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.

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported failure when running the test file with Jest, then inspect how react-native-get-random-values is initialized in the test environment. Check whether the package is available before getRandomBase64 is accessed; done means the test runs without this undefined-property error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100