setupTests.js 426 B

12345678910111213
  1. import { configure } from 'enzyme';
  2. import Adapter from 'enzyme-adapter-react-16';
  3. import * as jest from 'jest';
  4. // This is to get rid of this error while running tests:
  5. // "You will need to pass in an i18next instance by using initReactI18next"
  6. jest.mock('react-i18next', () => ({
  7. useTranslation: () => ({ t: key => key }),
  8. Trans: ({ children }) => children,
  9. t: key => key
  10. }));
  11. configure({ adapter: new Adapter() });