Closed lropero closed 6 years ago
btw this is in my packages.json:
"jest": {
"preset": "jest-expo",
"setupFiles": [
"<rootDir>/jestConfig.js"
],
"timers": "fake",
"transformIgnorePatterns": []
},
Wondering how relevant this is on detachment, but currently this is important to me too.
Thanks for the homework @lropero - interested if any project maintainers have any hints on your comments/suggestions?
This is also an issue for me
I believe you could implement something custom by creating your own version of mock.js and/or react-native.js that did the mixing and matching in the way that you wanted.
Unfortunately, this is out of scope of what this package is intended to do right now. I'm going to go ahead and close this issue, but if you have any suggested code changes that would make that work easier for you or add to this project in a way that would make it support your use case I'm happy to review and merge your PR.
When using jest-expo as a preset for Jest (I'm working on a detached Expo project, jic) and then trying to use react-native-mock-render by adding this line to my Jest config file:
This error occurs when running my tests:
The failing check is at node_modules/expo/src/environment/validate.js:
I believe this happens because both libraries are mocking react-native in a non-
Object.assign(rn, rn1, rn2)
-form.Couldn't both libraries work together somehow? I believe this would allow things like mounting (as opposed to shallowing) with enzyme, jsdom, and react-native-mock-render on test suites.