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 open handles in tests and update testing tools #1028

Merged
merged 7 commits into from
Dec 5, 2023

Conversation

zatteo
Copy link
Contributor

@zatteo zatteo commented Nov 22, 2023

  • Fix open handles in tests so that there are no more 1xx lines to scroll before seeing what went wrong in tests
  • Update testing tools
  • Fix issues coming from the testing tools update

Following @testing-library/react-native package update, I got a
"Trying to detect host component names triggered the following error"
error in useCookieResyncOnResume test.

I updated how we mock react-native with the recommended guidelines.

See
https://callstack.github.io/react-native-testing-library/docs/troubleshooting#mocking-react-native
We have a lot of open handles flooding the end of our test results. It seems that they are due to a React issue fixed in 18+.

Dan Abramov wrote a small package to fix the issue temporarly. I added it here manually because it has an error in the semver version check. This code should be removed when upgrading React to 18+.

facebook/react#20756 (comment)
There are useless warnings coming from the update of @testing-library/react-native linked to the Switch component and dispatchCommand. They are removed in React Native 0.72. This is a temporary mock to keep our tests clean.

callstack/react-native-testing-library#1422
@zatteo zatteo merged commit 1e52f2d into master Dec 5, 2023
1 check passed
@zatteo zatteo deleted the test/fix-open-handles branch December 5, 2023 08:57
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