Skip to content

Move to @testing-library/react-native 🎉 #442

Closed

Description

@kentcdodds

We're in the process of completely replacing https://github.com/testing-library/native-testing-library with this repo. Which means renaming react-native-testing-library to @testing-library/react-native.

Would anyone be interested in writing a migration guide?

EDIT:
Migration guide: https://callstack.github.io/react-native-testing-library/docs/migration-v7

Activity

  1. balavishnuvj commented on Jul 16, 2020

    @balavishnuvj

    I could help.

  2. thymikee commented on Jul 16, 2020

    @thymikee
    Member

    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?

  3. balavishnuvj commented on Jul 17, 2020

    @balavishnuvj

    @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.

  4. ryanjwessel commented on Jul 17, 2020

    @ryanjwessel
    Contributor

    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).

    Hope this helps!

  5. thymikee commented on Jul 17, 2020

    @thymikee
    Member

    I'm happy to accept a PR that aliases *ByA11yLabel to *ByLabelText to ease the migration :)

  6. ryanjwessel commented on Jul 17, 2020

    @ryanjwessel
    Contributor

    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?

  7. thymikee commented on Jul 17, 2020

    @thymikee
    Member

    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 :)

  8. ryanjwessel commented on Jul 17, 2020

    @ryanjwessel
    Contributor

    @thymikee Just put a PR up for it now. I think I see what you mean, hopefully this was what you were thinking. 😄

  9. vanGalilea commented on Jul 18, 2020

    @vanGalilea
    Contributor

    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:

  10. thymikee commented on Jul 21, 2020

    @thymikee
    Member

    Thank you very much @vanGalilea!

  11. kentcdodds commented on Jul 24, 2020

    @kentcdodds
    Author

    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

  12. vanGalilea commented on Jul 24, 2020

    @vanGalilea
    Contributor

    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

  13. added this to the 7.x milestone on Jul 24, 2020
  14. thymikee commented on Jul 24, 2020

    @thymikee
    Member

    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 :)

  15. kentcdodds commented on Jul 25, 2020

    @kentcdodds
    Author

    Anyone have interest in taking over https://github.com/testing-library/jest-native as part of this?

    testing-library/jest-native#31

  16. thymikee commented on Jul 28, 2020

    @thymikee
    Member

    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!

  17. changed the title [-]Migration guide?[/-] [+]Move to `@testing-library/react-native` 🎉[/+] on Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions