Skip to content

Commit

Permalink
remove unneeded mock but create new jest free version of mock
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed May 14, 2021
1 parent 5e528f6 commit ac6b41b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = ({config}) => {
config.resolve.alias = {
'react-native-config': 'react-web-config',
'react-native$': 'react-native-web',
'@react-native-community/netinfo': './mock',
'@react-native-community/netinfo': path.resolve(__dirname, '../__mocks__/@react-native-community/netinfo.js'),
};

// Necessary to overwrite the values in the existing DefinePlugin hardcoded to the Config staging values
Expand Down
7 changes: 6 additions & 1 deletion __mocks__/@react-native-community/netinfo.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
export {default} from '@react-native-community/netinfo/jest/netinfo-mock';
export default {
configure: () => {},
fetch: () => {},
addEventListener: () => {},
useNetInfo: () => {},
};
5 changes: 1 addition & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/libs/NetInfo/mock.js

This file was deleted.

0 comments on commit ac6b41b

Please sign in to comment.