-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: navigator is not defined #11
Comments
Hey @chmac, thanks for opening this issue. The whole navigator mock definitely needs some extra work to make it more complete. Quick question: What version of RN are you using? I remember that when I added the Thanks for adding the link as well. I'm gonna dig into it to fix this. If you come up with a solution in the meantime, feel free to open a PR 👍 |
I spent a little time on it, but I couldn't get it working. I added I tried naively changing it to EDIT: This thread could be useful. |
Hey @chmac! I know it's been a while, but I finally fixed this bug. A new version has been published (1.3.0) with the fix in case you still need to use it. Sorry for the delay, and thanks! |
I've added this package to my dev dependencies, I've imported it and run
mock.initAll()
in my test setup file, but I still see the following error:I'm accessing geolocation like
navigator.geolocation.requestAuthorization()
.I had a look at the mock-geolocatin implementation and it looks like it specifically targets the
navigator
global. Maybe the solution is to do something similar here?The text was updated successfully, but these errors were encountered: