You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 👆 [Clicking buttons and asserting onPress' outcome](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-cli-app/__tests__/Counter.test.tsx).
14
-
- 📲 [Filling a simple login form and asserting successful submission](https://github.com/vanGalilea/react-native-testing/blob/master/__tests__/LoginSubmission.test.tsx).
15
-
- 🎣 [Custom hook testing (number of alternatives)](https://github.com/vanGalilea/react-native-testing/blob/master/__tests__/CounterUsesCustomHook.test.tsx).
- 🎭 [Mocking and interacting with RN's Modal component](https://github.com/vanGalilea/react-native-testing/blob/master/__tests__/Modal.test.tsx).
22
-
- 🧾 [Handling with a screen with RN's FlatList component](https://github.com/vanGalilea/react-native-testing/blob/master/__tests__/FlatList.test.tsx).
23
-
- 📡 [Using MSW to mock api calls and handling loading/errors](https://github.com/vanGalilea/react-native-testing/blob/master/__tests__/ListWithFetch.test.tsx).
14
+
- 📲 [Filling a simple login form and asserting successful submission](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-cli-app/__tests__/LoginSubmission.test.tsx).
15
+
- 🎣 [Custom hook testing (number of alternatives)](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-cli-app/__tests__/CounterUsesCustomHook.test.tsx).
- 🧭 [Navigating through screens with React Navigation](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-cli-app/__tests__/LoginSubmission.test.tsx#L13).
18
+
- 🚟 [Navigating through screens with Expo Router](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-expo-app/__tests__/app/index.test.tsx).
19
+
- 🔚 [E2E feel due to real navigation throughout screens](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-cli-app/__tests__/Home.test.tsx).
20
+
- 📥 [Handling and mocking providers](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-cli-app/src/test/test-utils.tsx).
- 🎭 [Mocking and interacting with RN's Modal component](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-cli-app/__tests__/Modal.test.tsx).
23
+
- 🧾 [Handling with a screen with RN's FlatList component](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-cli-app/__tests__/FlatList.test.tsx).
24
+
- 📡 [Using MSW to mock api calls and handling loading/errors](https://github.com/vanGalilea/react-native-testing/blob/main/apps/rn-cli-app/__tests__/ListWithFetch.test.tsx).
24
25
25
26
### Tools in use 🛠️
26
27
-[Jest](https://jestjs.io/)
@@ -31,25 +32,39 @@
31
32
-[RN- Setting up the development environment](https://reactnative.dev/docs/environment-setup)
- Clone the repo` git clone git@github.com:vanGalilea/react-native-testing.git`
36
37
- Run `yarn` to install dependencies
38
+
- Explore RN CLI app and/or Expo app's tests and source code that are relevant to your use case.
39
+
40
+
41
+
## RN CLI application
42
+
### How to run the tests 🏃♀️
43
+
- Run `cd apps/rn-cli-app` to navigate to the app folder
37
44
- Run `yarn test:unit` to run the unit tests
38
45
- Run `yarn test:unit:dev` to run the unit tests in dev/watch mode
39
46
- Run `yarn test:unit:coverage` to run the tests and generate a coverage report
47
+
48
+
Make sure you have built and run the app in dev mode before running the e2e tests.
40
49
- Run `yarn test:e2e` to run the e2e tests
41
50
- Run `yarn test:e2e:dev` to run the e2e tests in dev/watch mode
42
51
- Run `yarn test:e2e:record` to run the e2e tests and record a video of the tests
43
52
44
53
### How to run the app 📱
45
-
- Clone the repo
46
-
- Run `yarn` to install dependencies
54
+
- Run `cd apps/rn-cli-app` to navigate to the app folder
47
55
- Run `npx pod-install` to install iOS dependencies
48
56
- Run `yarn start` to start the metro bundler
49
57
- Click `i` to run the app on iOS simulator or `a` to run it on Android emulator
50
58
51
-
### Ideas and future improvements 🚀
52
-
- ⚛️ Add tests for react native web project
59
+
## Expo application
60
+
### How to run the tests 🏃♀️
61
+
- Run `cd apps/rn-expo-app` to navigate to the app folder
62
+
- Run `yarn test:unit` to run the unit tests
63
+
64
+
### How to run the app 📱
65
+
- Run `cd apps/rn-expo-app` to navigate to the app folder
66
+
- Run `yarn start` to start the metro bundler
67
+
- Click `i` to run the app on iOS simulator or `a` to run it on Android emulator
53
68
54
69
### Inspiration, resources and further reading 📚
55
70
- 📑 A blog by [Steve Galili]([url](https://github.com/vanGalilea)) on ["Where and How to Start Testing Your React Native App"](https://medium.com/@stevegalili/where-and-how-to-start-testing-your-react-native-app-%EF%B8%8F-and-how-to-keep-on-testin-ec3464fb9b41)
@@ -61,7 +76,6 @@ For more info check [Epic React](https://epicreact.dev/).
0 commit comments