Enzyme expects an adapter to be configured
问题 I created a new React application by create-react-app and I wanted to write a unit test to a component named "MessageBox" that I created in the application. This is the unit test that I wrote: import MessageBox from "../MessageBox"; import { shallow } from 'enzyme'; import React from 'react'; test('message box', () => { const app = {setState: jest.fn()}; const wrapper = shallow(<MessageBox app={app}/>); wrapper.find('button').at(0).simulate('click'); expect(app.setState)