File tree Expand file tree Collapse file tree 4 files changed +11
-25
lines changed Expand file tree Collapse file tree 4 files changed +11
-25
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,11 @@ const cracoConfig = {
151
151
'<rootDir>/node_modules/vfile/lib' ;
152
152
jestConfig . moduleNameMapper [ 'vfile/do-not-use-conditional-minurl' ] =
153
153
'<rootDir>/node_modules/vfile/lib' ;
154
+
155
+ jestConfig . setupFiles = [
156
+ ...jestConfig . setupFiles ,
157
+ './src/i18n/i18n.ts' // Setup i18next configuration
158
+ ]
154
159
return jestConfig ;
155
160
}
156
161
} ,
Original file line number Diff line number Diff line change @@ -4,12 +4,14 @@ import { initReactI18next } from 'react-i18next';
4
4
5
5
import { i18nLanguageCode , resources } from './locales' ;
6
6
7
+ const isDevelopment = process . env . NODE_ENV === 'development' ;
8
+
7
9
i18n
8
10
. use ( LanguageDetector )
9
11
. use ( initReactI18next )
10
12
. init ( {
11
13
fallbackLng : i18nLanguageCode . ENGLISH ,
12
- debug : true ,
14
+ debug : isDevelopment ,
13
15
resources,
14
16
interpolation : {
15
17
escapeValue : false // not needed for react as it escapes by default
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import { render } from '@testing-library/react' ;
2
- import { I18nextProvider } from 'react-i18next' ;
3
2
import { Provider , useDispatch } from 'react-redux' ;
4
3
import * as ReactRouter from 'react-router' ;
5
4
import { StaticRouter } from 'react-router-dom/server' ;
6
5
import { fetchAuth } from 'src/commons/application/actions/SessionActions' ;
7
- import i18n from 'src/i18n/i18nForTests' ;
8
6
9
7
import { mockInitialStore } from '../../../commons/mocks/StoreMocks' ;
10
8
import Login from '../Login' ;
@@ -37,11 +35,9 @@ describe('Login', () => {
37
35
const store = mockInitialStore ( ) ;
38
36
const app = (
39
37
< Provider store = { store } >
40
- < I18nextProvider i18n = { i18n } >
41
- < StaticRouter location = "/login" >
42
- < Login />
43
- </ StaticRouter >
44
- </ I18nextProvider >
38
+ < StaticRouter location = "/login" >
39
+ < Login />
40
+ </ StaticRouter >
45
41
</ Provider >
46
42
) ;
47
43
const tree = render ( app ) ;
You can’t perform that action at this time.
0 commit comments