-
Notifications
You must be signed in to change notification settings - Fork 23
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
Reports don't show correct lines covered #60
Comments
This module is definitely designed to help you view coverage on your source code, not on compiled code like you have shown. I'm not sure how you have set up I believe I'm actually not familiar with how |
I see, thanks for the explanation @jmcriffey. With so many tools now wanting to do their own babel compilation (rather than just relying on the compiliation to have already occurred once somewhere upstream in the tool chain, and use the supplied source maps to map back to the original source), I think in my case I'll just wait for the official istanbul repo to finalise it's sourcemap support (gotwarlost#212). Otherwise, I'll see if the
to:
|
Just a follow up, in case anyone else is looking at getting I removed the The
With that in place, I was able to get the coverage reports to correctly show the original es2015 source and the correct lines being covered. However... This was without any So I added the following
With this in place, I now get a bunch of errors:
Something (not yet sure what, whether its Will continue to troubleshoot and see if I can get anywhere. |
@scottohara any luck withthis? |
@mmahalwy Yes, the problem was the It would seem that removing this fixed the issue (and |
Toggle --source-map option to true while running angular tests with code coverage report gen |
I'm attempting to use
babel-istanbul
withkarma-coverage
and source/test code compiled with babel 6:I'm getting the correct coverage results; but the HTML reports don't seem to reflect the actual lines that were covered/uncovered.
Here's a simple contrived example. First we have simple class
Foo
, with two methodsbar()
andbaz()
:A test that has 100% coverage for this class is:
The relevant parts of
karma.conf.js
for this are below. Basically, I'm usingkarma-babel-preprocessor
to transpile the source (using the es2015 preset); thenkarma-coverage
with instrumentation bybabel-istanbul
:The command to run the test suite is simply
karma start
.The result is 100% coverage as expected; and the HTML report looks like this:
Now if I remove the test that invokes
Foo.baz()
(ie. delete the wholedescribe("baz", ...)
section) and run again, the coverage drops (as expected) to 96%.But looking at the HTML report, it doesn't really indicate that it is the
baz()
function that was not covered:Is this working as intended?
The text was updated successfully, but these errors were encountered: