Skip to content

Instantly share code, notes, and snippets.

@edvinasbartkus
Created August 3, 2020 07:38
Show Gist options
  • Save edvinasbartkus/202c2e8558af120953672279db405242 to your computer and use it in GitHub Desktop.
Save edvinasbartkus/202c2e8558af120953672279db405242 to your computer and use it in GitHub Desktop.
Mock __mocks__/@react-native-community/netinfo.js
export default {
getCurrentConnectivity: jest.fn(),
isConnectionMetered: jest.fn(),
addListener: jest.fn(),
removeListeners: jest.fn(),
isConnected: {
fetch: () => {
return Promise.resolve(true)
},
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
},
fetch: jest.fn(),
};
export const useNetInfo = () => ({})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment