You can use /* istanbul ignore else*/ just before the if statement to ignore the missing else.
0
votes
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'.
0
votes
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);
}
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more