-
Notifications
You must be signed in to change notification settings - Fork 102
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
Update to @testing-library/react-native and add @testing-library/jest-native #1184
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1184 +/- ##
==========================================
+ Coverage 74.77% 75.02% +0.25%
==========================================
Files 525 526 +1
Lines 18404 18410 +6
Branches 3282 3282
==========================================
+ Hits 13762 13813 +51
+ Misses 4595 4536 -59
- Partials 47 61 +14
Continue to review full report at Codecov.
|
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.
Amazing!! Thanks 🚀
Let's try to fix the skipped tests before merging.
Do you see what's needed to add them back?
// @ts-ignore | ||
import { toBeDisabled } from '@testing-library/jest-native' |
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.
Why is @ts-ignore
needed here?
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.
If I remove the // @ts-ignore I receive the warning the following warning in the IDE; however the tests run without issue.
Module '"@testing-library/jest-native"' has no exported member 'toBeDisabled'.ts(2305)
@jeanregisser @lisaqyli tests have been skipped in the following specs due to issues with the upgrade to
|
Great, do you want some help to get make the skipped test pass? |
@jeanregisser any of the tests remaining in the above comment I could use help fixing. |
This reverts commit 2b63ea6.
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.
🥳
Description
Migration from
react-native-testing-library
to@testing-library/react-native
: Migration Guide V2 & Migration Guide V7.@testing-library/jest-native
was also added to cover asserts on disabled elements to replace checks on props that failed with the update to@testing-library/react-native
.Other changes
Mobile test batching introduced in Batch Mobile Tests #1021 has been removed as the underlying issue is resolved.
flushMicroTasksQueue
is now a helper function in/tests/utils
as it has been deprecated by@testing-library/react-native
.Cleanup in
packages/mobile/jest_setup.ts
has been removed as it is built in to@testing-library/react-native
.Deprecated methods that were used in tests have been marked with
UNSAFE_
read more about it here.waitForElement is now waitFor - WaitFor API Changes.
Use
@testing-library/react-native
render
method instead ofreact-test-renderer
render
method.Tested
How others should test
yarn test
yarn test <target.test.tsx>
Related issues
Backwards compatibility
This change is not backwards compatible, but all existing tests have been updated to use
@testing-library/react-native
and@testing-library/jest-native
.