RealOrangeOne / react-native-mock

A fully mocked and test-friendly version of react native (maintainers wanted)
MIT License
570 stars 153 forks source link

fix: remove deprecated addons package #130

Closed samouss closed 4 years ago

samouss commented 7 years ago

Fixed #129

RealOrangeOne commented 7 years ago

Correct me if i'm wrong, but making these changes will break compatability with lower versions? This isnt a problem, but if it does, we should change the version numbers to enforce this.

samouss commented 7 years ago

Yes, I think it will be the case.

samouss commented 7 years ago

How can I do this ? With peerDependencies ?

RealOrangeOne commented 7 years ago

Yes, change the peerDependencies, but also the react-* dependencies can be updated to 16 if a version is available

samouss commented 7 years ago

I change the version of the package, change some code for avoid warning due to deprecation.

But I don't know how to handle the different versions of React. That's why the CI failed on Node v4. Ideas?

RealOrangeOne commented 7 years ago

Looks like the versioning issue is because react-native@0.43 needs react@16, but we're installing everything at 15.5 ish. I think the solution is either change the versions of these up to 16, or change the regexes so they're >=15.5 rather than ^15.5

samouss commented 7 years ago

Sorry for the late answer.

I try the regExp but I still have a warning of missing peerDependencies, because all the package require react@^15.5 and only React Native require the 16 version. It's not a problem on Node 6 but it does on Node 4.

I don't know how to handle it.

RealOrangeOne commented 7 years ago

How strange. Try reverting all the changes you made to version numbers for constraint then, as it seems it worked before you made these changes. Maybe then it'll work?

samouss commented 7 years ago

I don't think so, because I try to build the master branch with Node 4 after a fresh clone and I have the same problem with peerDependencies but with different versions.

I try to revert all the changes related to version, deprecation, etc... I still have the error.

With fresh clone:

npm ERR! Darwin 16.4.0
npm ERR! argv "/Users/s.vaillant/.nvm/versions/node/v4.8.2/bin/node" "/Users/s.vaillant/.nvm/versions/node/v4.8.2/bin/npm" "i"
npm ERR! node v4.8.2
npm ERR! npm  v2.15.11
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package react@15.5.4 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-dom@15.5.4 wants react@^15.5.4
npm ERR! peerinvalid Peer react-native@0.38.1 wants react@~15.4.0-rc.4

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/s.vaillant/Web/test/npm-debug.log
RealOrangeOne commented 7 years ago

Sounds like the issue is because react@16 isn't fully released yet, so other libraries arent supporting it yet. Might have to hold off on this PR until it is, so the other libraries can catch up

samouss commented 7 years ago

It seems a good option, I don't know how to handle this conflict versions.

But it doesn't solve the problem for the master branch. If someone send a PR now, the CI will not pass due to this error of peerDependencies on Node 4.

willdawsonme commented 7 years ago

Any update on this?

Brian-Kaplan commented 7 years ago

Go to Jest, the contributors to this repo are too slow to keep up with facebook and Jest is the official test framework for react (as denoted by facebook)

RealOrangeOne commented 7 years ago

@Brian-Kaplan I disagree, many people arent able to move to Jest, and being official doesnt necessarily make it better.

I plan to focus most of my time on this and the remaining open issues in the coming weeks, however time has been thin recently.

Brian-Kaplan commented 7 years ago

@RealOrangeOne I definitely didn't say it was better, and I agree it's not. My team now has more work to do in terms of creating a useable test framework with Jest. We are, however, confident that moving to Jest is the right choice. Mainly because the lack of movement on this issue solidifies the fact that we would not be able to keep up to date on react-native if we use this repo. Although it creates more work for us in terms of test framework we get important bug fixes released by facebook.

"however time has been thin recently." - thats clear

gpeal commented 7 years ago

@samouss @RealOrangeOne @Brian-Kaplan Any update on this?

dan-kez commented 6 years ago

Any update on this?

evollu commented 6 years ago

I'm getting Error: Couldn't find preset "airbnb" relative to directory when running test. which version of babel-preset-airbnb should I use? and why does this lib need airbnb preset? @samouss

jeaye commented 6 years ago

Please merge this so anyone on RN 43, 44, 45, 46, 47, 48, 49, or 50 can use react-native-mock.

samouss commented 6 years ago

I don't think it's necessary since the rewrite is almost done. We should probably close this one in favour of #120.

cc @RealOrangeOne