0

我正在尝试使用mount

import React from 'react';
import { mount } from 'enzyme'

import { Provider } from 'react-redux';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';

describe('component', ()=>{
       const middlewares = [thunk];

        const mockStore = configureStore(middlewares);
        const store = mockStore({data: [] });
        const wrapper = mount(
          <Provider store={store}>
            <Component onClick={jest.fn()} shouldFetch={true} />
          </Provider>
        );`enter code here`

        it('THEN should', ()=>{
         })

})

但是当我执行测试时出现错误:

TypeError: value.includes is not a function

但是当我尝试shallow一切都很好时

4

0 回答 0