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
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/testing.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,8 @@ If you're not using Jest, then you'll need to mock these modules according to th
79
79
80
80
We recommend using [React Native Testing Library](https://callstack.github.io/react-native-testing-library/) along with [`jest-native`](https://github.com/testing-library/jest-native) to write your tests.
81
81
82
-
We are going to write example tests illustrating the difference between `navigate` and `push` functions, drawer's screens `preload` and times functions in tests.
82
+
We are going to write example tests illustrating the difference between `navigate` and `push` functions, how drawer's screens `preload`
83
+
works and what you have to do to use times functions in tests.
83
84
84
85
To show the difference between `navigate` and `push` functions, we will use `RootNavigator` defined below:
85
86
@@ -439,6 +440,7 @@ test('navigates to settings without previous preload', () => {
439
440
</Tabs>
440
441
441
442
With preloading test example:
443
+
442
444
<TabsgroupId="example"queryString="example">
443
445
<TabItemvalue="static"label="Static"default>
444
446
@@ -584,7 +586,7 @@ test('navigates to settings with previous preload', () => {
584
586
</TabItem>
585
587
</Tabs>
586
588
587
-
For writing tests that include times functions you will need to use [Fake Timers](https://jestjs.io/docs/timer-mocks). They will replace times function implementation to use time from the fake clock.
589
+
For writing tests that include times functions we will have to use [Fake Timers](https://jestjs.io/docs/timer-mocks). They will replace times function implementation to use time from the fake clock.
588
590
589
591
Let's add another button to the Profile screen, which uses `setTimeout`:
0 commit comments