testing-library / native-testing-library

🐳 Simple and complete React Native testing utilities that encourage good testing practices.
https://native-testing-library.com
MIT License
516 stars 44 forks source link

Support React Native 0.63.x #136

Closed daveols closed 4 years ago

daveols commented 4 years ago

What:

Fixed issues:

132 - mock LogBox in the Jest preset

126 - remove deprecated native mocks and add some new ones similar to how it's done in React Native core

113 - fixed by adding the component display name to TouchableOpacity and TouchableHighlight mocks via Jest preset

I've also upgraded react-navigation example tests to reference version v4 and all tests to use the latest React and React Native.

Why:

Green tests make me happy.

How:

Checklist:

The documentation will need to be updated to indicate support for Pressable.

~This might require a major version bump. I haven't had time to check backwards compatibility outside of React Native 0.62.2.~

EDIT Confirmed compatibility issues with React Native versions <0.62.0 due to the LogBox mock:

 Cannot find module 'react-native/Libraries/LogBox/LogBox' from 'mock-modules.js'

Removing the mock makes these changes backwards compatible (at least in the project that I tested it in, 100+ tests, RN@0.61.4). Unless there's a better way to handle LogBox or to somehow conditionally mock it with Jest, we should bump the major version with these changes.

codecov[bot] commented 4 years ago

Codecov Report

Merging #136 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #136   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines          268       268           
  Branches        67        67           
=========================================
  Hits           268       268           
Impacted Files Coverage Δ
src/lib/events.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6de7d48...82ac4a6. Read the comment docs.

vanGalilea commented 4 years ago

Good work, all fixes we've been waiting for

drews256 commented 4 years ago

@bcarroll22 what needs to be done to move this forward? Anything I can help push along @daveols or @bcarroll22?

daveols commented 4 years ago

@drews256 I don't have any write access. We'll need @bcarroll22 to approve, merge, and cut a new release. In the meantime you can reference my fork in your dependencies in which I have compiled the distribution:

"@testing-library/react-native": "github:daveols/native-testing-library#support-react-native-63-dist"

I can't guarantee this will be up forever so make sure you update to the latest release once it's out.

drews256 commented 4 years ago

Yeah, I understand, this comment was mostly pinging @bcarrol22 but figured I'd ask if you wanted a hand with anything else before he took a look.

On Wed, Jul 15, 2020 at 8:23 PM Dave Olsen notifications@github.com wrote:

@drews256 https://github.com/drews256 I don't have any write access. We'll need @bcarroll22 https://github.com/bcarroll22 to approve, merge, and cut a new release. In the meantime you can reference my fork in your dependencies in which I have compiled the distribution:

"@testing-library/react-native": "github:daveols/native-testing-library#support-react-native-63-dist"

I can't guarantee this will be up forever so make sure you update to the latest release once it's out.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/testing-library/native-testing-library/pull/136#issuecomment-659134430, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNFSPJ7CMBLRNCU2DW64VDR3ZXDNANCNFSM4OZG56QQ .

daveols commented 4 years ago

Ah, gotcha. Nothing from this end @drews256, I think it's good to go.

julien9999 commented 4 years ago

please merge

daveols commented 4 years ago

Apparently this repo is to be deprecated, see: callstack/react-native-testing-library#442

@kentcdodds @nickmccurdy in the meantime it would be great to get these fixes out for those who are still dependent on this project and aren't currently in a position to migrate.

drews256 commented 4 years ago

Ahhhh. :-1: Can we confirm @kentcdodds and @nickmccurdy and then please throw a big fat deprecated note on the readme if that is actually the case.

React Native is already hard enough to keep up to date.

bcarroll22 commented 4 years ago

:tada: This PR is included in version 6.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

kentcdodds commented 4 years ago

@all-contributors please add @daveols for code, tests, and docs

allcontributors[bot] commented 4 years ago

@kentcdodds

I've put up a pull request to add @daveols! :tada:

nickserv commented 4 years ago

@drews256 If you use fix #n or fixes #n in a commit (replacing n with an issue number in this repository), it will be closed when merged and the bot will automatically mention the release that fixes it.