mirror of
https://github.com/status-im/react-native-i18n.git
synced 2025-01-22 18:10:53 +00:00
Add test & mock example
This commit is contained in:
parent
1915faa94a
commit
d181ecb697
7
example/src/__mocks__/react-native-i18n.js
vendored
Normal file
7
example/src/__mocks__/react-native-i18n.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
// @flow
|
||||
|
||||
import I18nJs from 'i18n-js';
|
||||
|
||||
I18nJs.locale = 'en'; // a locale from your available translations
|
||||
export const getLanguages = () => Promise.resolve('en');
|
||||
export default I18nJs;
|
12
example/src/__tests__/App.js
Normal file
12
example/src/__tests__/App.js
Normal file
@ -0,0 +1,12 @@
|
||||
import 'react-native';
|
||||
import React from 'react';
|
||||
import App from '../App.js';
|
||||
|
||||
// Note: test renderer must be required after react-native.
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer.create(
|
||||
<App />
|
||||
);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user