Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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