-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Testing: Remove react-test-renderer
use
#61263
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: 0 B Total Size: 1.74 MB ℹ️ View Unchanged
|
Interesting. Seems like we need to provide |
react-test-renderer
react-test-renderer
use
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.
Thank you for helping us stay on top of deprecations! 🙇🏻
* @param {Object} [options] Configuration options for the gesture event. | ||
* @param {boolean} [options.failed] Determines if the gesture should fail. | ||
* @param {number} [options.triggerIndex] In case there are multiple draggable triggers, this specifies the index to use. | ||
* @param {HTMLElement} block Block test instance. |
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.
The (original) spirit of these changes make sense to me — removing a deprecated package.
However, given the package remains a peer dependency for testing-library/react-native
for the time being and that React Native, to my understanding, doesn't support/relate to HTMLElement
— for now, at least — these changes feel a bit misleading.
Not necessarily requesting a change or stating we must rollback the changes, merely sharing thoughts to see how others perceive this.
cc/ @WordPress/native-mobile
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.
Hmm, looks like you're right. I can't recall where I was looking when changing this initially, but it doesn't seem to make sense.
In any case, the original purpose of the PR failed, so I'm happy to revert, see #61439.
This reverts commit 28054e3. Co-authored-by: tyxla <[email protected]> Co-authored-by: Mamaduka <[email protected]>
What?
This PR is replacing the last (jsdoc/ts) usages of
react-test-renderer
and removing the dependency altogetherWhy?
We're soon planning to update to React 19 and it deprecates
react-test-renderer
.I started this in hopes I could remove the dependency, but that's not possible just yet - it's still needed.
Anyway, we can remove the imports in types/jsdoc at least.
How?
We're changing the
import('react-test-renderer').ReactTestInstance
type toHTMLElement
, which it essentially is under the hood.This removes its usage in docs Ideally we should remove the dependency, but right now it's necessary for
@testing-library/react-native
.Testing Instructions
All checks should be green.
Testing Instructions for Keyboard
None
Screenshots or screencast
None