Create-react-app: Upgrade react-scripts to use jest 22

Created on 22 Dec 2017  路  2Comments  路  Source: facebook/create-react-app

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 )

Most helpful comment

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.)

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fson picture fson  路  3Comments

barcher picture barcher  路  3Comments

Aranir picture Aranir  路  3Comments

ap13p picture ap13p  路  3Comments

rdamian3 picture rdamian3  路  3Comments