wilcus wilcus - 1 month ago 9
Node.js Question

How to update Jest testing framework in create-react-app?

I already have an application created with

package.
I found a bug with the version of Jest which is 15.1.1. But I realized that in version 16 the bug is gone.

How to update Jest?

My problem is in the package.json of application there is no Jest package.

Jest is in other folder: node_modules/react-scripts.

Answer

The following commands are going to get the job done:

npm run eject
npm install --save-dev jest@16.0.0

But be careful here! The eject command irreversibly eliminates the abstraction layer of create-react-app exposing all of the dependencies and configuration to you. Though, your app is going to work just like before. You'll just have total control upon it, including the ability to update dependencies.

Comments