Mocking the useTranslation hook

This commit is contained in:
Jeff Avallone 2019-03-26 18:26:20 -04:00
parent dd8c405482
commit 280412e2db

View File

@ -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 })
};