completion
This commit is contained in:
60
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-localize.js
vendored
Normal file
60
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-localize.js
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/* global jest: true */
|
||||
// https://github.com/react-native-community/react-native-localize/blob/master/README.md#how-to-test-your-code
|
||||
const getLocales = () => [
|
||||
// you can choose / add the locales you want
|
||||
{
|
||||
countryCode: 'US',
|
||||
languageTag: 'en',
|
||||
languageCode: 'en',
|
||||
isRTL: false,
|
||||
},
|
||||
{
|
||||
countryCode: 'DE',
|
||||
languageTag: 'de',
|
||||
languageCode: 'de',
|
||||
isRTL: false,
|
||||
},
|
||||
{
|
||||
countryCode: 'JA',
|
||||
languageTag: 'ja',
|
||||
languageCode: 'ja',
|
||||
isRTL: false,
|
||||
},
|
||||
];
|
||||
|
||||
// use a provided translation, or return undefined to test your fallback
|
||||
const findBestAvailableLanguage = () => ({
|
||||
languageTag: 'en',
|
||||
isRTL: false,
|
||||
});
|
||||
|
||||
const getNumberFormatSettings = () => ({
|
||||
decimalSeparator: '.',
|
||||
groupingSeparator: ',',
|
||||
});
|
||||
|
||||
const getCalendar = () => 'gregorian'; // or 'japanese', 'buddhist'
|
||||
const getCountry = () => 'US'; // the country code you want
|
||||
const getCurrencies = () => ['USD', 'EUR']; // can be empty array
|
||||
const getTemperatureUnit = () => 'celsius'; // or 'fahrenheit'
|
||||
const getTimeZone = () => 'Europe/Paris'; // the timezone you want
|
||||
const uses24HourClock = () => true;
|
||||
const usesMetricSystem = () => true;
|
||||
|
||||
const addEventListener = jest.fn();
|
||||
const removeEventListener = jest.fn();
|
||||
|
||||
export {
|
||||
findBestAvailableLanguage,
|
||||
getLocales,
|
||||
getNumberFormatSettings,
|
||||
getCalendar,
|
||||
getCountry,
|
||||
getCurrencies,
|
||||
getTemperatureUnit,
|
||||
getTimeZone,
|
||||
uses24HourClock,
|
||||
usesMetricSystem,
|
||||
addEventListener,
|
||||
removeEventListener,
|
||||
};
|
||||
Reference in New Issue
Block a user