FormidableLabs / react-native-svg-mock

A mock implementation of react-native-svg for use in tests
MIT License
18 stars 7 forks source link

README.md instructions didn't work with jest #30

Open dmueller39 opened 6 years ago

dmueller39 commented 6 years ago

However the following did:

jest.mock('react-native-svg', () =>
  require('react-native-svg-mock/build/index')
);

Should I open a PR to add that to the README.md? Or is this unexpected?

carloskelly13 commented 6 years ago

@dmueller39 Hey 👋 What environment is this running in or how are you using it? I’d like to recreate the scenario to get a better feel for the usage here. Are you using it to test a component that imports primitives from react-native-svg? Thanks!

dmueller39 commented 6 years ago

@carlospaelinck I was setting up storyshots snapshot testing of components:

https://github.com/storybooks/storybook/tree/master/addons/storyshots

The components imported from 'react-native-svg'.