Skip to content

Instantly share code, notes, and snippets.

@MoOx
Created April 20, 2017 13:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MoOx/08b465c3eac9e36e683929532472d1e0 to your computer and use it in GitHub Desktop.
Save MoOx/08b465c3eac9e36e683929532472d1e0 to your computer and use it in GitHub Desktop.
jest + react-native + error "Something went wrong initializing the native ReactLocalization module"
// now no problem :D
// @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",
}
{
"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