Mocking the useTranslation hook
This commit is contained in:
parent
dd8c405482
commit
280412e2db
4
src/__mocks__/react-i18next.js
vendored
4
src/__mocks__/react-i18next.js
vendored
@ -1,6 +1,8 @@
|
||||
const reactI18next = jest.requireActual('react-i18next');
|
||||
const i18n = require('i18n');
|
||||
|
||||
module.exports = {
|
||||
...reactI18next,
|
||||
Trans: require('__mocks__/component-mock').buildMock(reactI18next.Trans)
|
||||
Trans: require('__mocks__/component-mock').buildMock(reactI18next.Trans),
|
||||
useTranslation: () => ({ i18n, t: i18n.mockT })
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user