What do the symbols mean?
letmaik opened this issue · 5 comments
There are several symbols and highlightings. It would be good if there was some documentation on what they actually mean.
I've updated the README with lots of branch coverage examples (as generated by istanbul)
Great, that's useful. I like that there are two detail modes and that simple is default now, however I think the simple mode doesn't really need symbols at all. Is there a case where they provide information that you can't see from the shading itself?
@letmaik Yes, like this one for example:
The else branch is missing in source code and line coverage will report this file as fully covered even if only the if branch is taken. Branch coverage points out that the else branch was missed.
A better example would be:
function sum(a,b) {
if (a >= 0) {
return a + b;
}
}
Tested via:
sum(0, 5);
sum(5, -1);
sum(12, 12);
Line coverage will report the function as fully covered, but branch coverage will point out that the tests do not cover the else branch -- no test calls the function with a < 0. If they would do, a bug would be discovered.
Makes sense, good examples!