添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Install Jest

This course is all about unit testing with Jest and in this lesson, we'll learn how to install Jest in our project.

To get started, we need a package.json . Go to your project directory and run the following commands in your terminal:

yarn init -y

Then we need to install Jest:

yarn add --dev jest

Add support for babel:

yarn add --dev babel-core babel-jest babel-preset-env

Create a babel preset file:

touch .babelrc

And add the current preset, to .babelrc :

"presets": [ "env"

And voilà, Jest is installed!