Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Weird HTML reports with [email protected] / babel-istanbul and ternary operators #608

Open
silkentrance opened this issue Apr 28, 2016 · 7 comments

Comments

@silkentrance
Copy link

Please see jeffrifwald#56 for more information on this.

@jeffrifwald
Copy link

jeffrifwald commented Apr 28, 2016

I think #557 may be either related or the same issue.

@silkentrance
Copy link
Author

Again having this issue with a different ternary operator

image

@silkentrance silkentrance changed the title Weird HTML reports with [email protected] / babel-istanbul Weird HTML reports with [email protected] / babel-istanbul and ternary operators Apr 28, 2016
@mynameistechno
Copy link

Is there a work around for this?

@silkentrance
Copy link
Author

@mynameistechno the only work around for this is to get rid of the ternary operator and make it an if-then-else statement...

@ltahilra
Copy link

I'm getting the same issue, the code coverage with ternary operator seems like this:
with ternary operator

However if you view page source you get the following:
t</span>his.mode = window ? 'WebBrowser' : <span class="branch-1 cbranch-no" title="branch not covered" >'server';
The </span> closing tag should ​_not_​ precede the open <span> tag. Seems the html is not rendered properly.

Adding a line break seems like one of the work around for this:
with line break

@saschagehlich
Copy link

Same happens here:

screenshot 2016-07-19 11 09 51

I guess HTML rendering is okay, but the coverage.raw.json is wrong?

@gotwarlost
Copy link
Owner

AFAIK, all this is happens because of https://phabricator.babeljs.io/T7453 - in essence, babel is producing incorrect source maps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants