Intermediate React Intermediate React

Creating a Jest CLI Script

This course has been updated! We now recommend you take the Intermediate React, v3 course.

Check out a free preview of the full Intermediate React course:
The "Creating a Jest CLI Script" Lesson is part of the full, Intermediate React course featured in this preview video. Here's what you'd learn in this lesson:

Add the ability to run jest from your npm scripts.

Get Unlimited Access Now

Transcript from the "Creating a Jest CLI Script" Lesson

>> Brian: So we've been running our jest with npx. The best way to do this is actually go into your package.json. Here, I have test. Let's just make that jest --silent, okay? And then we'll add another one called test:update. And we'll input that -u on that. So now instead of doing, clear, npm run test,

>> Brian: That'll run jest for us. In fact, test is special one, so you can actually go as far as npm t. It'll actually run test for you.