Posts

Testing React Native Apps

What are we unit testing exactly ? We're using  "unit testing"  to refer to tests of functions and plain JavaScript objects, independent of the React Native framework. This means that we aren't testing any components that rely on React Native. For example, a unit could be individual methods and functions in classes or really any small pieces of functionality. We mock out dependencies in these tests so that we can test individual methods and functions in isolation. These test are written using testing frameworks and for this article i will be using  Jest , javascript testing framework together with  Enzyme  and  React Native Testing Library . Setting Install If you use  React Native CLI  installs the  Jest  testing framework by default. But if you're using Expo we need to install it manually. yarn add -D enzyme enzyme-adapter-react-16 More: yarn add react-dom react-native-testing-library Create new file  jestSetup.js  in root and add to j
Recent posts