Created
April 20, 2017 13:00
-
-
Save MoOx/08b465c3eac9e36e683929532472d1e0 to your computer and use it in GitHub Desktop.
jest + react-native + error "Something went wrong initializing the native ReactLocalization module"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// now no problem :D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import { NativeModules } from 'react-native'; | |
// monkey patching the locale to avoid the error: | |
// Something went wrong initializing the native ReactLocalization module | |
NativeModules.ReactLocalization = { | |
language: "en_US", | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"jest": { | |
"preset": "react-native", | |
"transformIgnorePatterns": [ | |
"node_modules/(?!(.*-)?react-(.*-)?native(-.*)?)" | |
], | |
"setupFiles": [ | |
"./jest-setup.js" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment