Categories
JavaScript Answers

How to fix console.log statements output nothing in Jest?

Spread the love

Sometimes, we want to fix console.log statements output nothing in Jest.

In this article, we’ll look at how to fix console.log statements output nothing in Jest.

How to fix console.log statements output nothing in Jest?

To fix console.log statements output nothing in Jest, we can set the silent option to false.

For instance, we run

npm run test -- --silent=false

to set silent to false given that test is a script in package.json that runs jest.

Conclusion

To fix console.log statements output nothing in Jest, we can set the silent option to false.

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 *