Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Testing React Components with Enzyme

John Blaine
John Blaine
5,002 Points

Testing React Components with Enzyme - Had to upgrade to React 16

I am working on the Testing React Components with Enzyme tutorial.

I ran into errors using the original project files, I had to upgrade react, react-dom to version 16. I then had this error:

"Enzyme Internal Error: Enzyme expects an adapter to be configured, but found none."

So, I installed enzyme-adapter-react-16 and added this code snippet to Repositories.spec.js:

//Begin code snippet import Adapter from 'enzyme-adapter-react-16'; import { configure } from 'enzyme'; configure({adapter: new Adapter()}); //End code snippet

I also had to remove PropTypes from Repository and Repositories because it has been deprecated in React-16.

Once I did this, everything seemed to work.

Thanks, John