Skip to content

Conversation

markmur
Copy link
Contributor

@markmur markmur commented Aug 20, 2025

What changes are you making?

Adds @testing-library/react-native and updates the context tests.


PR Checklist

Important

Releasing a new version of the kit?

Tip

See the Contributing documentation for instructions on how to publish a new version of the library.

@markmur markmur self-assigned this Aug 20, 2025
@markmur markmur requested a review from a team as a code owner August 20, 2025 11:32
Copy link

github-actions bot commented Aug 20, 2025

Coverage Report

Lines Statements Branches Functions
Coverage: 100%
100% (196/196) 99.04% (104/105) 100% (62/62)

@markmur markmur force-pushed the markmur/replace-react-test-renderer branch 2 times, most recently from cf86f99 to 8cc1718 Compare August 20, 2025 11:37
@markmur markmur force-pushed the markmur/replace-react-test-renderer branch from 8cc1718 to c029d80 Compare August 20, 2025 12:37
package.json Outdated
"react-native-gesture-handler": "^2.15.0",
"react-native-gradle-plugin": "^0.71.19",
"react-test-renderer": "18.3.1",
"react-test-renderer": "18.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as @testing-library/react-native is a replacement for react-test-renderer - can we remove this dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@testing-library/react-native is built on top of react-test-renderer so it's still required as a peer dependency → https://github.com/callstack/react-native-testing-library/blob/main/package.json#L59

Copy link
Contributor

@kieran-osgood-shopify kieran-osgood-shopify Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah my bad I always end up on the wrong docs page for @testing-library/react-native

Useful to know - its marked as deprecated from react-native 77 / React19
Once we get to 77 and as of v14 a replacement is in an open PR here: callstack/react-native-testing-library#1705

Copy link
Contributor Author

@markmur markmur Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, looks like they're replacing it with a universal-test-renderer package

@markmur markmur force-pushed the markmur/replace-react-test-renderer branch 2 times, most recently from 2ca9d57 to c23c7bf Compare August 22, 2025 10:58
@markmur markmur enabled auto-merge (squash) August 22, 2025 11:33
@markmur markmur force-pushed the markmur/replace-react-test-renderer branch from c23c7bf to 04ce4c4 Compare August 26, 2025 15:44
@markmur markmur force-pushed the markmur/replace-react-test-renderer branch from 04ce4c4 to 4d360b7 Compare August 26, 2025 15:49
Copy link
Contributor

@kieran-osgood-shopify kieran-osgood-shopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as its a stylistic point - but one benefit of moving to react testing lib is we can use screen queries instead of the destructuring from render https://github.com/testing-library/dom-testing-library/releases/tag/v6.11.0

reduces the amount of changes needed to maintain / experiment with queries

@markmur markmur merged commit 21d38ca into main Aug 26, 2025
8 checks passed
@markmur markmur deleted the markmur/replace-react-test-renderer branch August 26, 2025 16:09
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.

2 participants