Automattic / i18n-calypso

i18n JavaScript library on top of Jed originally used in Calypso
GNU General Public License v2.0
24 stars 19 forks source link

Remove react-addons-test-utils dependency #42

Closed ockham closed 7 years ago

ockham commented 7 years ago

To test: Verify that this isn't actually used anywhere in the code.

Relevant for https://github.com/Automattic/wp-calypso/pull/19083

akirk commented 7 years ago

I researched some and this was introduced in the inital commit of the repo. The only package I can see that is dependent on it is enzyme which is also just a devDependency. I don't know if this sub-depencency prevents us from removing this, though.

ockham commented 7 years ago

Hmm, you're right :-/

rm -r node_modules/
npm install
npm run test

gives

react-addons-test-utils is an implicit dependency in order to support react@0.13-14. Please add the appropriate version to your devDependencies. See https://github.com/airbnb/enzyme#installation
ockham commented 7 years ago

Makes me wonder if we can make it work if we force i18n-calypso to use React >=15.

ockham commented 7 years ago

Okay, so I tentatively updated enzyme to 2.9.1 (which is the latest 2.x version). That gave me

Error: react-dom@15.5+ and react-test-renderer are implicit dependencies when using react@15.5+ with enzyme. Please add the appropriate version to your devDependencies. See https://github.com/airbnb/enzyme#installation

3189d1f fixes that. Think that's legit?

akirk commented 7 years ago

I'm pretty sure as the tests still pass (and enzyme is only used for them).

ockham commented 7 years ago

Cool, I'll merge this then!