Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to display remapped coverage report in the terminal? #101

Closed
Pickra opened this issue Jan 25, 2017 · 7 comments
Closed

How to display remapped coverage report in the terminal? #101

Pickra opened this issue Jan 25, 2017 · 7 comments

Comments

@Pickra
Copy link

Pickra commented Jan 25, 2017

I apologize if I'm missing something obvious or if I'm repeating this issue.

Current Behavior

The remapped coverage works in the browser:

screen shot 2017-01-24 at 3 58 48 pm
screen shot 2017-01-24 at 3 55 43 pm

The terminal is displaying the unmapped coverage, look at "branch" and "uncovered lines":

screen shot 2017-01-19 at 3 12 28 pm

jest config in package.json

screen shot 2017-01-25 at 12 07 58 pm

Desired Behavior

Remapped coverage displays in the terminal.

What am I missing?
Thanks in advance.

@kwonoj
Copy link
Contributor

kwonoj commented Jan 25, 2017

refer #42 (comment) .

@Pickra
Copy link
Author

Pickra commented Jan 26, 2017

Thanks for the quick response. Sorry for the repeat question.

@Vinnl
Copy link

Vinnl commented Apr 21, 2017

I've been trying to wrap my head around the current status of this, and I thought it'd be a good idea to jot down my current conclusions (both to inform others, and to double-check any incorrect assumptions I've made).

So, as far as I can tell, it is currently impossible for ts-jest to tell Jest what the correct coverage is (although it can output the correct coverage to the developer, [currently])(#61) in the remapped directory inside the coverage directory configured for Jest).

However, a PR has been accepted into Jest that should make this possible in the future. If the developer enables the mapCoverage option, then from Jest 20 onwards (we're at version 19 at the time of writing), ts-jest and other preprocessors should be able to report the actual coverage back to Jest. Or at least, the actual coverage as far as the source maps are accurate, which should be fine most of the time.

So for now, we'll have to wait for Jest 20, after which ts-jest can be extended to report the coverage back to Jest.

As a workaround until that time, I've created a small CLI-tool that you can point at your remapped coverage report to pass or fail a CI build depending on whether thresholds are met.

@Pickra
Copy link
Author

Pickra commented Apr 22, 2017

Thanks for the update and work around, much appreciated.

@kulshekhar
Copy link
Owner

Coverage is no longer handled by ts-jest (see #200)

If this issue isn't addressed AND if you think the fix needs to be in ts-jest, feel free to either open a new issue or leave a comment here to reopen this.

@Pickra
Copy link
Author

Pickra commented May 8, 2017

Thanks for the update on this issue @kulshekhar

@screendriver
Copy link
Contributor

Unfortunately it does not work at the moment: #211

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

No branches or pull requests

5 participants