Reviving a deprecated package with unclear implementation details and potential architectural implications.
The issue requests reviving `react-test-renderer`, a deprecated package, to provide official test utilities for React. The task involves addressing the deprecation reasons, potentially redesigning the package to avoid exposing internal fiber data structures, and ensuring compatibility with React 19. The main blocker is the unclear implementation path and potential architectural changes required.
Ideally react is shipped with official test utilities instead of relying on third-party vendors.
Unfortunately it was decided to deprecatereact-test-renderer.
As a consequence it isn't easy anymore to:
@testing-library/react is an integration testing library, promotes testing anti-patterns and completely ditches unit tests.
It is slow and requires a DOM or a mock like js-dom.
Please refer to these resources for a comprehensive understanding of why unit tests are of high value:
react-test-rendereris deprecated. A warning will fire whenever callingReactTestRenderer.create()orReactShallowRender.render(). Thereact-test-rendererpackage will remain available on NPM but will not be maintained and may break with new React features or changes to React’s internals. https://react.dev/warnings/react-test-renderer
react-test-rendereris deprecated and no longer maintained. It will be removed in a future version. As of React 19, you will see a console warning when invokingReactTestRenderer.create(). https://www.npmjs.com/package/react-test-renderer/v/19.0.0-canary-8afa144bd-20240416?activeTab=readme#react-test-renderer-deprecated
Note: that affects any code using react-test-renderer
https://github.com/search?q=repo%3Ajestjs
Claim this issue to let others know you're working on it. You'll earn 35 points when you complete it!