'TS2345: Argument of type 'MouseEvent' is not assignable to parameter of type 'MouseEvent<{}, MouseEvent>'

I wrote this test

const wrapper = shallow(
  <AddButton handleAddCoreTarget={handleAddCoreTarget} />
);
const event = new MouseEvent('click', {});

wrapper.find('button').props().onClick(event);

expect(handleAddCoreTarget).toBeCalledTimes(1);
expect(handleAddCoreTarget).toHaveBeenNthCalledWith(1, event);

But I got this error TS2345: Argument of type 'MouseEvent' is not assignable to parameter of type 'MouseEvent<{}, MouseEvent>'.

I guess my type of event is not good but how I could fix it ?



Sources

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

Source: Stack Overflow

Solution Source