Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: jest setup was voiding custom turbo mocks #636

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DoctorJohn
Copy link
Contributor

@DoctorJohn DoctorJohn commented Sep 6, 2024

Description

This PR updates the jest.setup.ts file to make it suitable to be used by projects using the rn google mobile ads library. The docs are updated accordingly.

I made sure we only mock our own native modules in the jest.setup.ts file so the mocks won't interfere with other libraries' or custom mocks.

Related issues

Checklist

  • I read the Contributor Guide
    and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in __tests__e2e__
    • jest tests added or updated in __tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

  • I successfully used the updated jest.setup.ts file via setupFiles in one of my projects (before I used custom mocks for this library)
  • I made sure yarn tests:jest still passes all tests just like before after I removed the Platform mock

Copy link

docs-page bot commented Sep 6, 2024

To view this pull requests documentation preview, visit the following URL:

docs.page/invertase/react-native-google-mobile-ads~636

Documentation is deployed and generated using docs.page.

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.11%. Comparing base (a34c7ba) to head (8e22af6).
Report is 56 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #636      +/-   ##
==========================================
- Coverage   43.72%   43.11%   -0.60%     
==========================================
  Files          30       31       +1     
  Lines         549      573      +24     
  Branches      151      153       +2     
==========================================
+ Hits          240      247       +7     
- Misses        309      326      +17     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛] Jest Setup file is deleting TurboModuleRegistry.get, breaking test suites
1 participant