Skip to content

Commit

Permalink
Merge pull request #8880 from parasharrajat/story-fix-build
Browse files Browse the repository at this point in the history
[No QA] Fix: Storybook Build
  • Loading branch information
arosiclair authored May 5, 2022
2 parents 9ef8ac2 + 3f94180 commit 8d6368e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions __mocks__/@react-native-community/netinfo.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
import NetInfoMock from '@react-native-community/netinfo/jest/netinfo-mock';
const defaultState = {
type: 'cellular',
isConnected: true,
isInternetReachable: true,
details: {
isConnectionExpensive: true,
cellularGeneration: '3g',
},
};

export default NetInfoMock;
const RNCNetInfoMock = {
configure: () => {},
fetch: () => Promise.resolve(defaultState),
refresh: () => Promise.resolve(defaultState),
addEventListener: () => (() => {}),
useNetInfo: () => {},
};

export default RNCNetInfoMock;

0 comments on commit 8d6368e

Please sign in to comment.