Skip to content

Commit

Permalink
docs: document jest mocking on a dedicated page
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorJohn committed Sep 6, 2024
1 parent b89c760 commit 8e22af6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
["European User Consent", "/european-user-consent"],
["Ad Inspector", "/ad-inspector"],
["Impression-level ad revenue", "/impression-level-ad-revenue"],
["Video ad volume control", "/video-ad_volume-control"]
["Video ad volume control", "/video-ad_volume-control"],
["Testing", "/testing"]
]
],
[
Expand Down
17 changes: 17 additions & 0 deletions docs/testing.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Testing

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.

## Testing with Jest

This library ships with a Jest setup file that mocks the native code for you.
To use it, add the following to your Jest configuration:

```json
// jest.config.js|ts|mjs|cjs|json
{
"setupFiles": [
"./node_modules/react-native-google-mobile-ads/jest.setup.ts"
]
}
```

0 comments on commit 8e22af6

Please sign in to comment.