Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. const useMock : any = [(k: any) => k, {}];
  2. useMock.t = (k: any) => k;
  3. useMock.i18n = {};
  4.  
  5. jest.mock('react-i18next', () => ({
  6. // this mock makes sure any components using the translate HoC receive the t function as a prop
  7. /* tslint:disable-next-line:variable-name */
  8. useTranslation: () => useMock,
  9. }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement