Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Latest commit

 

History

History
24 lines (19 loc) · 1.05 KB

03-test-against-different-react-releases-with-enzyme.md

File metadata and controls

24 lines (19 loc) · 1.05 KB

Test Against Different React Releases with Enzyme

📹 Video

Setting up Enzyme with different releases of React

At the time of writing these notes, Create React App uses React 16. In order to use Enzyme with React 16, we need to install the enzyme-adapter-react-16 package:

npm install --save-dev enzyme-adapter-react-16

With this package, we can now configure our application to use this adapter. In src/App.test.js:

// ...
import { configure } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'

configure({ adapter: new Adapter() })
// ...

More information about the enzyme-adapter-react-16 package and what package to use with specific versions of React can be found in the resources.

Resources