Chances are high that, in this very moment, your React app has untested lines of code. These are essentially lines of codes that are being executed consistently within the control flow of your program without proper unit tests to cover them. If it sounds like an incredibly daunting task to manually walk through each line of your code and ensure that they are all covered by unit tests, that’s because it is! So how can you identify and provide a solution to this problem?

Enter Istanbul.

Istanbul is a JavaScript code coverage tool that works by analyzing your codebase and providing you with the coverage insights you need in order to understand, file by file, where unit tests are needed in your app. In this guide, you will learn not only what Istanbul is, but how to use it and incorporate it into your React app.

#react

Using Istanbul for Code Coverage in React
2.55 GEEK