Code Coverage Reports and Custom Configuration with Istanbul, Jest, and React

<p>A few months ago, I met the one and only Robert &ldquo;Uncle Bob&rdquo; Martin (&ldquo;Clean Code,&rdquo; &ldquo;The Clean Coder,&rdquo; &ldquo;Clean Architecture,&rdquo; etc ). One of many questions people had for him was, &ldquo;What parts on my application need to be covered with unit tests?&rdquo; His response was, &ldquo;Well, only the ones you want to work.&rdquo;</p> <p>Great response, right?</p> <p>The more I write code, the more I believe that the 100% (or close to it) line-coverage threshold is not crazy but mandatory. One of the best things about good coverage is coverage reports that are green across all files.</p> <p>Seeing all green makes people happy, and they tend to keep it green<em>&nbsp;</em>(i.e<em>.</em>, adding new tests when they add new code). No one wants to be that guy that made a file red after it was green for a long time.</p> <p><a href="https://betterprogramming.pub/code-coverage-reports-and-custom-configuration-with-istanbul-jest-and-react-34e44c968b7c"><strong>Read More</strong></a></p>
Tags: Jest React