Closed joncursi closed 8 years ago
I'm not sure youre meant to be importing things from react native with paths like that. You should probably be getting the components from the keys of react-native itself. As our project doesnt use the same directory structure as react-native, this is unlikely to work. Are the modules youre getting from libs/ available off react-native?
That's the interesting thing! I'm only importing standard components from the React Native docs, so I'm trying to figure out why my test setup is getting tripped up on react native internals. I figured this could be due to the RN 0.33.0 upgrade and the way this package handles that, but it looks like I was wrong. I'll continue to investigate in my repo and report back any findings.
Thanks!
during tests, you shouldnt be touching react-native itself at all. So i'm confused why this is a problem with versions of react-native. I can only presume that you are somewhere requiring like that with paths.
Ah, so it turns out this issue was being caused by react-native-svg.
The following snippet inside mocha's setup.js
fixed the issue:
import mockery from 'mockery';
...
mockery.registerMock('react-native-svg', () => null);
Sorry for logging this where it didn't belong!
Great. I would also be tempted to open an issue against react-native-svg, as they really shouldnt be importing react-native things like that
As of React Native 0.33.0, my build started failing as it could not find the
react-native/lib/*
files. Example:I've gotten around this with mockery:
While this got past the above errors, it prompted a new one:
I assume these to be issues with RN 0.33.0?