LinusU / LinusU/react-native-get-random-values

Error Cannot read property 'getRandomBase64' of undefined when running test file

Open
#22 4 comments 11 reactions 0 assignees View on GitHub

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.

Screen Shot 2020-10-02 at 10 37 22

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.