Created
June 9, 2017 09:19
-
-
Save kykean/952179fee07ec6aef14449c880c03b55 to your computer and use it in GitHub Desktop.
jest manual mock to replace react-i18next, so tests can use mount with stubs covering lifecycle methods.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// place in __mocks__/react-i18next.js , same directory level with node_modules | |
const i18next = jest.genMockFromModule('react-i18next'); | |
i18next.t = (i) => i; | |
i18next.translate = (c) => (k) => k; | |
module.exports = i18next; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment