When upgrading jest to v22, our tests (run with react-scripts) break due to react-scripts v1.0.17 still using v20, while v22 added a breaking change, upgrading JSDOM from v9 to v11.
This results in the tests breaking with error TypeError: environment.setup is not a function. (related issue raised @jest )
You can't "update Jest to v22" while using react-scripts. The point of react-scripts is to hide Jest (and a few other tools) under one umbrella. It is not, and has never been supported to try to install tools directly.
I suppose it's time we start breaking the build when people attempt that. We get too many issues like this when people break their setups.
(As for updating to 22, yes, we'll do that in the near future. We were just waiting for it to come out.)
We track Jest update in https://github.com/facebookincubator/create-react-app/issues/2639.
I created a new issue for breaking the build when one attempts to update tools circumventing react-scripts: https://github.com/facebookincubator/create-react-app/issues/3638.
So I think we can close this.
Most helpful comment
You can't "update Jest to v22" while using
react-scripts. The point ofreact-scriptsis to hide Jest (and a few other tools) under one umbrella. It is not, and has never been supported to try to install tools directly.I suppose it's time we start breaking the build when people attempt that. We get too many issues like this when people break their setups.
(As for updating to 22, yes, we'll do that in the near future. We were just waiting for it to come out.)