You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Awesome @balavishnuvj! Let me know if you need any help. So far, in terms of differences between the libs, I'm only aware of the "disabled" property being specially handled by the second library. Is there anything else?
I am working on migrating a project from @testing-library/react-native to this one now.
The first difference I noticed was that '@testing-library/react-native/cleanup-after-each', in the jest.config.js was no longer required because it happens by default in this library (see docs here).
Second, there is a difference in querying by accessibility labels between the two libraries. @testing-library/react-native uses queryByLabelText (see here), whereas this library uses queryByAccessibilityLabel, or queryByA11yLabel (see here).
I would be happy to take on this PR, but it would be my first time contributing to the project.
To clarify, we would alias any queries ending in ByLabelText to use ByA11yLabel instead? Should we display some sort of warning that this is temporary to support migration from the other library?
Great! No warning is needed, queryByAccessibilityLabel is already an alias of queryByA11yLabel, so it's a matter of extending that to another value. Should be fairly straight-forward I hope :)
Awesome @balavishnuvj! Let me know if you need any help. So far, in terms of differences between the libs, I'm only aware of the "disabled" property being specially handled by the second library. Is there anything else?
You mean that the props 'disabled' is not available on TocuhableOpacity as a test instance?
Having that problem while migrating
Hey all, I've added a migration guide PR: #456. Please review, let me know if I missed anything and if there are any readability improvements we can make :)
I'm happy to watch jest-native over. Since the migration guide is created. I'm closing this issue. Thanks everyone for your cooperation, it was very helpful!
Activity
balavishnuvj commentedon Jul 16, 2020
I could help.
thymikee commentedon Jul 16, 2020
Awesome @balavishnuvj! Let me know if you need any help. So far, in terms of differences between the libs, I'm only aware of the "disabled" property being specially handled by the second library. Is there anything else?
balavishnuvj commentedon Jul 17, 2020
@thymikee I don't understand in and out of the library as of now. Would need your help. Also, this would one of my first open-source contributions.
ryanjwessel commentedon Jul 17, 2020
I am working on migrating a project from
@testing-library/react-nativeto this one now.The first difference I noticed was that
'@testing-library/react-native/cleanup-after-each',in thejest.config.jswas no longer required because it happens by default in this library (see docs here).Second, there is a difference in querying by accessibility labels between the two libraries.
@testing-library/react-nativeusesqueryByLabelText(see here), whereas this library usesqueryByAccessibilityLabel, orqueryByA11yLabel(see here).Hope this helps!
thymikee commentedon Jul 17, 2020
I'm happy to accept a PR that aliases
*ByA11yLabelto*ByLabelTextto ease the migration :)ryanjwessel commentedon Jul 17, 2020
I would be happy to take on this PR, but it would be my first time contributing to the project.
To clarify, we would alias any queries ending in
ByLabelTextto useByA11yLabelinstead? Should we display some sort of warning that this is temporary to support migration from the other library?thymikee commentedon Jul 17, 2020
Great! No warning is needed,
queryByAccessibilityLabelis already an alias ofqueryByA11yLabel, so it's a matter of extending that to another value. Should be fairly straight-forward I hope :)ryanjwessel commentedon Jul 17, 2020
@thymikee Just put a PR up for it now. I think I see what you mean, hopefully this was what you were thinking. 😄
vanGalilea commentedon Jul 18, 2020
Hi all,
Just migrated my real world examples repo, was pretty straightforward here are the diffs:
vanGalilea/react-native-testing@66f8fd3
vanGalilea/react-native-testing@364a4b4
Summary of all changes in my repo:
wait becomes waitFor
getByPlaceholderText becomes getByPlaceholder (chore: [TL migration] rename getByPlaceholder to getByPlaceholderText (or provide an alias) #447)
getByLabelText become getByA11yLabel (feat: introduce ByLabelText, ByRole and ByHintText a11y aliases #445)
*ByTestId can't handle a regex, only string
in jest.config.js:
package.json:
thymikee commentedon Jul 21, 2020
Thank you very much @vanGalilea!
kentcdodds commentedon Jul 24, 2020
v6 of @testing-library/react-native was just published. So when we publish this repo as the main package it will need to be version 7
vanGalilea commentedon Jul 24, 2020
You mean that the props 'disabled' is not available on TocuhableOpacity as a test instance?
Having that problem while migrating
thymikee commentedon Jul 24, 2020
Hey all, I've added a migration guide PR: #456. Please review, let me know if I missed anything and if there are any readability improvements we can make :)
kentcdodds commentedon Jul 25, 2020
Anyone have interest in taking over https://github.com/testing-library/jest-native as part of this?
testing-library/jest-native#31
thymikee commentedon Jul 28, 2020
I'm happy to watch
jest-nativeover. Since the migration guide is created. I'm closing this issue. Thanks everyone for your cooperation, it was very helpful![-]Migration guide?[/-][+]Move to `@testing-library/react-native` 🎉[/+]