gotwarlost/istanbul

Coverage different beahaviour with different coding styles

Opened this issue · 0 comments

I'm using Jest
Sorry if duplicated, but I found this behavior

if (this.popoverTo === 'right') {
  positionStyle = { left: 0 }
} else if (this.popoverTo === 'left') {
  positionStyle = { right: 0 }
}

Istanbul says } else if (this.popoverTo === 'left') { is not covered

But, if I make some changes to the coding styling

if (this.popoverTo === 'right') positionStyle = { left: 0 }
else if (this.popoverTo === 'left') positionStyle = { right: 0 }

I got 100% coverage, which is the correct report