Skip to content

Commit 8e22af6

Browse files
committed
docs: document jest mocking on a dedicated page
1 parent b89c760 commit 8e22af6

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
["European User Consent", "/european-user-consent"],
1919
["Ad Inspector", "/ad-inspector"],
2020
["Impression-level ad revenue", "/impression-level-ad-revenue"],
21-
["Video ad volume control", "/video-ad_volume-control"]
21+
["Video ad volume control", "/video-ad_volume-control"],
22+
["Testing", "/testing"]
2223
]
2324
],
2425
[

docs/testing.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Testing
2+
3+
The React Native Google Mobile Ads library depends on a lot of platform-specific native code which you likely want to mock in your tests.
4+
5+
## Testing with Jest
6+
7+
This library ships with a Jest setup file that mocks the native code for you.
8+
To use it, add the following to your Jest configuration:
9+
10+
```json
11+
// jest.config.js|ts|mjs|cjs|json
12+
{
13+
"setupFiles": [
14+
"./node_modules/react-native-google-mobile-ads/jest.setup.ts"
15+
]
16+
}
17+
```

0 commit comments

Comments
 (0)