'How Can I enable Lingui I18n translation package to be used in Unit test case with react-testing library jest

I am making unit test case uning jest and enzyme for my frontend application which is done in React.My unit case work if I dont use Lingui I18n translation package library.Now when I run the test it throws error of can not read the property of undefined.I tried mocking and but that does not work in my case.

describe('User Component',()=>{ test('should render first', () => {

  const wrapper = mount(<User  {...userProps} t={t} i18n={i18n} Trans={Trans} />);
  expect(wrapper.exists()).toBe(true);

})

});

1621 | {({i18n}) => > 1622 | this.onClickAdd()} /> 1624 | } 1625 |


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source