ReactNativeLocalization
ReactNativeLocalization copied to clipboard
Localizing snapshot
Hi, this is not an issue. It's a support request.
You suggest in the wiki to Snapshot
Were you able to configure Snapshot on a React Native project? If yes, would you mind share the steps?
Thanks, Fabrizio
Hi, I think Pavel Prokopenko wrtote that, because unfortunately I've never used snapshots either...
Sorry
Stefano
do you know Pavel Prokopenko handle?
Nope... just saw that he was the WIKI author...
Have you checked the documentation on the fastlane site?
Thank you @stefalda
What I am doing with jest is adding a jest-setup.js file and put this in it
// monkey patching the locale to avoid the error:
// Something went wrong initializing the native ReactLocalization module
NativeModules.ReactLocalization = {
language: 'fr_FR',
};
Then in jest config:
"setupFiles": [
"./jest-setup.js"
]
Can probably be configured via cli to allow multiples tests/snaps per language.
Just in case someone else tried @MoOx's fix, you have to add also
import { NativeModules } from 'react-native';
to the beginning of jest-setup.js file to get Jest working.
(I'm using TypeScript, not sure if NativeModules is available globally in JS world...)