-
Notifications
You must be signed in to change notification settings - Fork 264
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(user-event): Decouple press events from Jest dependency #1571
fix(user-event): Decouple press events from Jest dependency #1571
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1571 +/- ##
==========================================
+ Coverage 95.51% 95.61% +0.09%
==========================================
Files 99 99
Lines 5400 5404 +4
Branches 857 865 +8
==========================================
+ Hits 5158 5167 +9
+ Misses 242 237 -5 ☔ View full report in Codecov by Sentry. |
@mdjastrzebski I think Codecov might be using a cached version of the coverage report or something like that. When I generate the report, I see that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you for your effort 🚀
This PR has been released in RNTL v12.4.4! 🎉 |
….5 (#5196) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@testing-library/react-native](https://callstack.github.io/react-native-testing-library) ([source](https://togithub.com/callstack/react-native-testing-library)) | [`^12.4.3` -> `^12.4.5`](https://renovatebot.com/diffs/npm/@testing-library%2freact-native/12.4.3/12.4.5) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@testing-library%2freact-native/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@testing-library%2freact-native/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@testing-library%2freact-native/12.4.3/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@testing-library%2freact-native/12.4.3/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>callstack/react-native-testing-library (@​testing-library/react-native)</summary> ### [`v12.4.5`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.5) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.4...v12.4.5) #### RNTL 12.4.5 (2024-03-28) ##### Bugfixes - `findBy*` timeout with detached screen by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [callstack/react-native-testing-library#1576 ##### Other - docs: update docs about eslint rule by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [callstack/react-native-testing-library#1578 **Full Changelog**: callstack/react-native-testing-library@v12.4.4...v12.4.5 ### [`v12.4.4`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.4) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.3...v12.4.4) #### RNTL 12.4.4 (2024-03-18) ##### Bug Fixes - **user-event**: Decouple press events from Jest dependency by [@​JoseLion](https://togithub.com/JoseLion) in [callstack/react-native-testing-library#1571 #### New Contributors - [@​retyui](https://togithub.com/retyui) made their first contribution in [callstack/react-native-testing-library#1567 - [@​donysukardi](https://togithub.com/donysukardi) made their first contribution in [callstack/react-native-testing-library#1569 - [@​JoseLion](https://togithub.com/JoseLion) made their first contribution in [callstack/react-native-testing-library#1571 **Full Changelog**: callstack/react-native-testing-library@v12.4.3...v12.4.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
….5 (#5196) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@testing-library/react-native](https://callstack.github.io/react-native-testing-library) ([source](https://togithub.com/callstack/react-native-testing-library)) | [`^12.4.3` -> `^12.4.5`](https://renovatebot.com/diffs/npm/@testing-library%2freact-native/12.4.3/12.4.5) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@testing-library%2freact-native/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@testing-library%2freact-native/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@testing-library%2freact-native/12.4.3/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@testing-library%2freact-native/12.4.3/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>callstack/react-native-testing-library (@​testing-library/react-native)</summary> ### [`v12.4.5`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.5) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.4...v12.4.5) #### RNTL 12.4.5 (2024-03-28) ##### Bugfixes - `findBy*` timeout with detached screen by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [callstack/react-native-testing-library#1576 ##### Other - docs: update docs about eslint rule by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [callstack/react-native-testing-library#1578 **Full Changelog**: callstack/react-native-testing-library@v12.4.4...v12.4.5 ### [`v12.4.4`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.4) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.3...v12.4.4) #### RNTL 12.4.4 (2024-03-18) ##### Bug Fixes - **user-event**: Decouple press events from Jest dependency by [@​JoseLion](https://togithub.com/JoseLion) in [callstack/react-native-testing-library#1571 #### New Contributors - [@​retyui](https://togithub.com/retyui) made their first contribution in [callstack/react-native-testing-library#1567 - [@​donysukardi](https://togithub.com/donysukardi) made their first contribution in [callstack/react-native-testing-library#1569 - [@​JoseLion](https://togithub.com/JoseLion) made their first contribution in [callstack/react-native-testing-library#1571 **Full Changelog**: callstack/react-native-testing-library@v12.4.3...v12.4.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
….5 (valora-inc#5196) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@testing-library/react-native](https://callstack.github.io/react-native-testing-library) ([source](https://togithub.com/callstack/react-native-testing-library)) | [`^12.4.3` -> `^12.4.5`](https://renovatebot.com/diffs/npm/@testing-library%2freact-native/12.4.3/12.4.5) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@testing-library%2freact-native/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@testing-library%2freact-native/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@testing-library%2freact-native/12.4.3/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@testing-library%2freact-native/12.4.3/12.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>callstack/react-native-testing-library (@​testing-library/react-native)</summary> ### [`v12.4.5`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.5) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.4...v12.4.5) #### RNTL 12.4.5 (2024-03-28) ##### Bugfixes - `findBy*` timeout with detached screen by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [callstack/react-native-testing-library#1576 ##### Other - docs: update docs about eslint rule by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [callstack/react-native-testing-library#1578 **Full Changelog**: callstack/react-native-testing-library@v12.4.4...v12.4.5 ### [`v12.4.4`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.4) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.3...v12.4.4) #### RNTL 12.4.4 (2024-03-18) ##### Bug Fixes - **user-event**: Decouple press events from Jest dependency by [@​JoseLion](https://togithub.com/JoseLion) in [callstack/react-native-testing-library#1571 #### New Contributors - [@​retyui](https://togithub.com/retyui) made their first contribution in [callstack/react-native-testing-library#1567 - [@​donysukardi](https://togithub.com/donysukardi) made their first contribution in [callstack/react-native-testing-library#1569 - [@​JoseLion](https://togithub.com/JoseLion) made their first contribution in [callstack/react-native-testing-library#1571 **Full Changelog**: callstack/react-native-testing-library@v12.4.3...v12.4.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Summary
Solves #1568 by decoupling press events in
user-event
from Jest dependency. As mentioned in the issue, this is done by replacing instances ofjest.fn()
with a simplenoop()
function, which does not cause any breaking change.Additionally, it solves a small bug with
warnAboutRealTimersIfNeeded()
that caused the warning to be triggered even whenRNTL_SKIP_AUTO_DETECT_FAKE_TIMERS
is present.Test plan
This PR can be tested following the issue's Steps to Reproduce:
userEvent.press(..)
callTypeError: event.persist is not a function