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:
parent
62360e8981
commit
6a1e0516e9
|
@ -131,6 +131,11 @@ const mockNativeModules = {
|
|||
addListener: jest.fn(),
|
||||
removeListeners: jest.fn(),
|
||||
},
|
||||
LocationObserver: {
|
||||
getCurrentPosition: jest.fn(),
|
||||
startObserving: jest.fn(),
|
||||
stopObserving: jest.fn(),
|
||||
},
|
||||
ModalFullscreenViewManager: {},
|
||||
Networking: {
|
||||
sendRequest: jest.fn(),
|
||||
|
|
Loading…
Reference in New Issue