-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Invariant Violation: Native module cannot be null" when running tests after upgrade from 0.38 to 0.39.1 #11585
Comments
I'm getting the same error, this is my
|
this error results from creating a NativeEventEmitter on a module that hasn't been mocked |
I don't know what to do with that information. I've searched for NativeEventEmitter in all the js in my node_modules folder and there are 141 occurences -- all in the reactnative library. |
I'm getting this too on a very new RN project with jest. Even a trivial test like add two numbers fails. Guessing one of my dependencies includes react-native-experimental-navigation as a dependency. I'm not using it directly. |
I get this as well. I have several components that reference |
I know mine is, |
Same error here using |
This fixed it for me (though obviously is a hacky workaround) |
I'll give that a shot thanks @bufke |
@bufke Looks like it worked. But I don't know why, which would be great. Thanks much! Full solution:
|
* test setup * adds first test * fixes Linking error with react-native-router-flux facebook/react-native#11585 * move folders
@jcollum I followed 3 step of you, but it still not working.
|
Adding |
Originally reported here: jestjs/jest#2382 (comment)
Description
https://github.com/jcollum/kishar-nine/tree/02-routing -- RN 0.38
https://github.com/jcollum/kishar-nine/tree/03-redux-counter -- RN 0.39.1
After upgrading to 0.39.1 the tests fail:
Reproduction
Clone the repo.
$ rm -rf node_modules/ && git checkout 02-routing && npm install --silent && npm test
Tests pass.
rm -rf node_modules/ && git checkout 03-redux-counter && npm install --silent && npm test
Tests fail with above error message.
Additional Information
The text was updated successfully, but these errors were encountered: