glamorous-native icon indicating copy to clipboard operation
glamorous-native copied to clipboard

Use enzyme's `mount` in unit tests

Open atticoos opened this issue 8 years ago • 0 comments

Currently the unit tests use shallow and react-test-render. mount is particularly useful for stepping through component workflows and lifecycle events. However, mount has known challenges with React Native (https://github.com/airbnb/enzyme/issues/614)

I've got it working with the suggestions in https://blog.joinroot.com/mounting-react-native-components-with-enzyme-and-jsdom, and mirroring the setup in https://github.com/rjanjua/React-Testing-Guide.

However, there are some issues with Jest snapshots, where it appears that rendered elements appear twice in the snapshot.

atticoos avatar May 18 '17 20:05 atticoos