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?
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?
You can use /* istanbul ignore else*/
just before the if
statement to ignore the missing else
.
You can use /* istanbul ignore else */
to tell istanbul not to include that in the coverage.
/* istanbul ignore else */
if (props.onChange) {
props.onChange(event);
}
If you don't want the comments all over the place you can also set up another test where you actually hit that else.
If you have something like this:
_method: function () {
if (this.foo === 'foo') {
this.bar = false
}
}
You just need to create a test where this.foo
does not equal 'foo
'.
© 2022 - 2024 — McMap. All rights reserved.