With Enzyme 3x come adapter packages. Its a bit tedious to insert into every test file
import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-15";
configure({ adapter: new Adapter() });
when you can create just a single setup file to serve all the tests.
That's what src/setupTests.js
is for: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#initializing-test-environment
I can't believe I missed that! Thanks
Most helpful comment
That's what
src/setupTests.js
is for: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#initializing-test-environment