Increase resolution of coverage so that a ternary expression shows code coverage if one branch is not covered. (Otherwise my team is going to make me always use 8-line ifs instead of 1-line ternaries just so we can see code coverage completely :'( )
Ian Bowyer commented
I was going to add a sample code example but seeing that this is 7 years old with no feed back begs to see if anyone actually reads these and actions on them. Here's the example in case they do...
1. var result = await _exampleRepository.GetAsync(request.Id, cancellationToken);
2. return result ?? throw new NotFoundException(request.Id);
Will show as green light if the happy path has a tested but no test on the NotFoundException
In Comparison the following shows no coverage on line 4
1. var result = await _exampleRepository.GetScreenAsync(request.Id, cancellationToken);
2. if (result == null)
4. throw new NotFoundException(request.Id);
Same for test and body on same line.
if(false) return "notCoveredButMarkerIsGreen";
wallaby js use another color for patial cover