Categories
JavaScript Answers

How to get the code coverage report using Jest?

Spread the love

Sometimes, we want to get the code coverage report using Jest.

In this article, we’ll look at how to get the code coverage report using Jest.

How to get the code coverage report using Jest?

To get the code coverage report using Jest, we run jest with the coverage option.

For instance, we run

npx jest --coverage

to run Jests tests and generate a code coverage report after that.

Conclusion

To get the code coverage report using Jest, we run jest with the coverage option.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *