O'Reilly logo

React 16 Tooling by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running tests using standalone Jest

The test script from react-scripts that you just learned about in the previous section is a great tool to have running in the background while you're building your application. It gives you immediate feedback as you implement components and unit tests.

Other times, you just want to run all tests and have the process exit as soon as the result output is printed. For example, if you're integrating Jest output into a continuous integration process or if you just want to see test results run once, you can run Jest directly.

Let's try running Jest on its own. Make sure that you're in your project directory still and that you've stopped the npm test script from running. Now just run:

jest

Rather than running ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required