There has got to be a simple way to do this, but I can't find documented syntax anywhere. I have a React component with a prop that I'd like to mock in Jest like this:
jest.mock('./common/MultiSelect', 'MultiSelect');
That works, except that I end up with a React warning cluttering my test results:
Warning: Unknown prop
options
on tag. Remove this prop from the element.
The component I'm mocking does have an options prop, and I really don't care how it's rendered, so how can I mock it in such a way it will not throw the warning? I've tried using React.createElement in the mock, and returning an array with element name and props arguments to no end.
The component I want to mock is used like this:
<MultiSelect
options={['option 1', 'option 2']}
/>