Skip to content

Commit

Permalink
jest example: if no children, show i18nKey
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Feb 14, 2023
1 parent ac6004c commit 7f76aa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/test-jest/src/__mocks__/react-i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ useMock.i18n = {};
module.exports = {
// this mock makes sure any components using the translate HoC receive the t function as a prop
withTranslation: () => Component => props => <Component t={k => k} {...props} />,
Trans: ({ children }) =>
Trans: ({ children, i18nKey }) => !children ? i18nKey :
Array.isArray(children) ? renderNodes(children) : renderNodes([children]),
Translation: ({ children }) => children(k => k, { i18n: {} }),
useTranslation: () => useMock,
Expand Down

0 comments on commit 7f76aa9

Please sign in to comment.