Skip to content

Commit 178aecc

Browse files
author
Harris Robin Kalash
committed
Updates testing-your-app/detox.md
Auto commit by GitBook Editor
1 parent a43e46e commit 178aecc

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

SUMMARY.md

+7
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,11 @@
1010
* [Renaming Your App](renaming-your-app.md)
1111
* [Rename App Automatically](renaming-your-app/rename-app-automatically.md)
1212
* [Rename App Manually Manual](renaming-your-app/rename-app-manually-manual.md)
13+
* Debugging your UI
14+
* [Testing Your App](testing-your-app.md)
15+
* [Jest](testing-your-app/jest.md)
16+
* [Detox](testing-your-app/detox.md)
17+
* Keep Tabs On Native Logs
18+
* Upgrade React Native with Caution!
19+
* CI/CD Tools
1320

testing-your-app.md

Whitespace-only changes.

testing-your-app/detox.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Detox is another great tool I wish I had earlier. What Detox does is best described in their documentation:
2+
3+
> High velocity native mobile development requires us to adopt continuous integration workflows, which means our reliance on manual QA has to drop significantly. Detox tests your mobile app while it's running in a real device/simulator, interacting with it just like a real user.
4+
5+
Getting started with Detox in React Native is fairly straight forward. You can find their Introduction [here](https://github.com/wix/detox/blob/master/docs/Introduction.GettingStarted.md).
6+
7+
8+

testing-your-app/jest.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Jest
2+
3+
Testing react-native apps for regression is incredibly daunting as your app grows. It can quickly become a nightmare to test things manually.
4+
5+
Luckily, React Native ships with Jest, one of my favourite testing frameworks.
6+
7+
The basic setup you need to start testing your React Native app with Jest includes:
8+
9+
**Install the appropriate packages:**
10+
11+
`yarn add jest babel-jest react-test-renderer --dev`
12+
13+
**Modifying your package.json to include the following:**
14+
15+
```
16+
"scripts": {
17+
"test": "jest"
18+
},
19+
"jest": {
20+
"preset": "react-
21+
}
22+
23+
```
24+
25+
**Add the following to your .babelrc:**
26+
27+
```
28+
{
29+
"presets": ["react-native"]
30+
}
31+
```
32+
33+
now if you run `yarn test` you should see your tests running.
34+
35+
36+
37+
38+

0 commit comments

Comments
 (0)