Search code examples
code-coveragekarma-coverage

Why does my coverage report show covered lines in red?


I am able to use Karma, Tape, and Istanbul (specifically, babel-istanbul) to get what look like correct coverage reports of my ES6 codebase, but the HTML report shows some covered lines in red, even as it shows in the margin that they have been covered some number of times in the test suite:

enter image description here

In particular, line 13 shows 4x coverage, which reflects the test I just wrote (which calls concat() four times).

Why is that line red?


Solution

  • I think what's happening is that the lines are being run the number of times listed in the margin, but they are red because some aspect of coverage hasn't been hit. Looking at my screenshot I'm not sure what that could be for line 13, for example, but hovering the mouse over a red line pops up a message explaining what was missed.