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: docs/testing.md
+53-5
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ sidebar_position: 50
4
4
5
5
# Testing
6
6
7
-
## Setting up a mock
7
+
## Setting up the mock
8
8
9
-
If you use Jest for testing, you may need to mock the functionality of the native module - this is because the native code cannot run in Node environment.
9
+
If you want to write JS-level tests that depend on Google Sign In, you need to mock the functionality of the native module - this is because the native code cannot run in Node environment.
10
10
11
11
This library ships with a Jest mock that you can add to the `setupFiles` array in your Jest config.
12
12
@@ -20,6 +20,54 @@ By default, the mock behaves as if the calls were successful and returns mock us
20
20
}
21
21
```
22
22
23
-
[//]: #'### Writing tests'
24
-
[//]: #
25
-
[//]: #'You can use [`@testing-library/react-native`](https://callstack.github.io/react-native-testing-library/) to write tests for React components that use React Native Google Sign In.'
23
+
## Writing tests
24
+
25
+
You can use [`@testing-library/react-native`](https://callstack.github.io/react-native-testing-library/) to write tests for React components that use React Native Google Sign In. Minimal example (make sure to [set up the mock](#setting-up-the-mock) first):
0 commit comments