How to ignore branch coverage for missing 'else'

rajesh madaswamy picture rajesh madaswamy · Aug 7, 2015 · Viewed 9k times · Source

Is it possible to ignore the marker E in istanbul branch coverage?

I am using Jasmine+karma+Istanbul. Is there any possibility to ingore E and get 100% branch coverage?

Maybe a property that can be set in config?

Here is an example of the coverage results example of the error

Answer

Anobika picture Anobika · Aug 20, 2015

You can use /* istanbul ignore else*/ just before the if statement to ignore the missing else.