Add Geolocation API Jest mock

Summary:
Hello!

The [Geolocation API](https://facebook.github.io/react-native/docs/geolocation.html) is currently not mocked in Jest, which often leads to an `Invariant Violation: Native module cannot be null` error. This patch adds a basic Jest configuration similar to the existing ones for the other modules.

None unfortunately, but this patch makes my test suite all green 😉

Thanks,
William
Closes https://github.com/facebook/react-native/pull/13442

Differential Revision: D4883830

Pulled By: javache

fbshipit-source-id: c2a976834cca7537bd832a698e8cd25cf877705b
This commit is contained in:
William Durand 2017-04-13 09:16:09 -07:00 committed by Facebook Github Bot
parent 62360e8981
commit 6a1e0516e9
1 changed files with 5 additions and 0 deletions

View File

@ -131,6 +131,11 @@ const mockNativeModules = {
addListener: jest.fn(), addListener: jest.fn(),
removeListeners: jest.fn(), removeListeners: jest.fn(),
}, },
LocationObserver: {
getCurrentPosition: jest.fn(),
startObserving: jest.fn(),
stopObserving: jest.fn(),
},
ModalFullscreenViewManager: {}, ModalFullscreenViewManager: {},
Networking: { Networking: {
sendRequest: jest.fn(), sendRequest: jest.fn(),