File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1818 },
1919 "peerDependencies" : {
2020 "jest" : " ^24.9.0" ,
21- "babel-jest" : " ^24.9.1 "
21+ "babel-jest" : " ^24.9.0 "
2222 }
2323}
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+
3+ export const t = jest . fn ( key => `translated_${ key } ` ) ;
4+
5+ export const useTranslation = ( ) => {
6+ return {
7+ t,
8+ i18n : {
9+ loadNamespaces : jest . fn ( )
10+ }
11+ } ;
12+ } ;
13+
14+ export const withTranslation = ( ) => Component => props => {
15+ return < Component { ...props } t = { key => `translated_${ key } ` } /> ;
16+ } ;
Original file line number Diff line number Diff line change 11module . exports = {
22 moduleNameMapper : {
3- '\\.(css|less|woff|woff2|eot|ttf)$' : '<rootDir>/node_modules/@jahia/test-framework/build/js/__mocks__/styleMock.js'
3+ '\\.(css|less|woff|woff2|eot|ttf|svg)$' : '<rootDir>/node_modules/@jahia/test-framework/build/js/__mocks__/styleMock.js' ,
4+ '^react-i18next$' : '<rootDir>/node_modules/@jahia/test-framework/build/js/__mocks__/react-i18next.js'
45 } ,
56 setupFilesAfterEnv : [
67 '<rootDir>/node_modules/@jahia/test-framework/build/js/setupTests.js'
You can’t perform that action at this time.
0 commit comments