Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Update Enzyme to v3.x #871

Closed
1 of 4 tasks
emilyrohrbough opened this issue Sep 26, 2017 · 3 comments
Closed
1 of 4 tasks

Update Enzyme to v3.x #871

emilyrohrbough opened this issue Sep 26, 2017 · 3 comments
Milestone

Comments

@emilyrohrbough
Copy link
Contributor

Issue Description

This is the most up-to-date version, plus v3.x provides support for > React 16! 🎉 They authors have even provided a v2 to v3 migration guide.

Issue Type

  • New Feature
  • Enhancement
  • Bug
  • Other
@bjankord
Copy link
Contributor

bjankord commented Oct 3, 2017

@emilyrohrbough Haven't had a chance to look into this, do you know, is enzyme v3 compatible with react v15, or is it only compatible with react v16?

@emilyrohrbough
Copy link
Contributor Author

emilyrohrbough commented Oct 3, 2017

V3 requires the configuration of a react adaptor, where the adaptor chosen is the react version listed as the project dependency. The configuration appears to be simple, including the following in a setup file:

import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

Enzyme.configure({ adapter: new Adapter() });

I'm not sure yet how this would tie in with our monorepo structure and current jest setup that creates global enzyme methods.

To be compatible with React 15 we will need to use the enzyme-adapter-react-15 adaptor, so to test both 15 & 16 we many need to look into setting up separate react testing environments.

@bjankord bjankord added this to the Backlog milestone Oct 13, 2017
@mhemesath
Copy link
Contributor

mhemesath commented Nov 3, 2017

I'd think it would be sufficient to just use enzyme-adapter-react-15.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants