0

Invariant Violation: Could not find "store" in the context of "Connect(Component)". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to Connect(Component) in connect options.

  319 |    
> 321 |             const wrapper = mount(<Provider store={store}>
      |                             ^
  322 |                          <{...props}/>
  323 |                        </Provider>);
  324 |             expect(wrapper).toMatchSnapshot();

1 Answers1

1

Try adding a react-redux mock at the top of your test file after the imports:

jest.mock('react-redux', () => ({
  connect: () => (ReactComponent) => ReactComponent,
}));
Ian
  • 1,746
  • 1
  • 15
  • 28