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

Istanbul code coverage line number #63

Open
Geminii opened this issue Dec 9, 2019 · 3 comments
Open

Istanbul code coverage line number #63

Geminii opened this issue Dec 9, 2019 · 3 comments

Comments

@Geminii
Copy link

Geminii commented Dec 9, 2019

Hi,

When execute npm run test:unit, here is the following result :

----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |    86.36 |    70.45 |    83.33 |    86.36 |                   |
 Logo.vue |      100 |    89.47 |      100 |      100 |              5,12 |
 Todo.vue |       80 |       56 |       80 |       80 |... ,68,89,120,126 |
----------|----------|----------|----------|----------|-------------------|

Problem :
The Logo.vue isn't coverage in branch at 100% because there are some missing conditionnals states according to Istanbul.
I check on my project, and get the same strange thing : uncovered line are totally incorrect.
In this example, line 5 at Logo corresponding to html class.
Another example, Todo.vue : uncovered line 120, 126 ... but there are only 73 line in this file :/

How to resolve this ?
I try to follow this https://stackoverflow.com/questions/44120502/nyc-coverage-shows-incorrect-line-numbers. But i got this error : Module not found : babel-register

Thanks for your help :)
Thanks for this repository to start with NuxtJs and Ava :)

@vinayakkulkarni
Copy link
Owner

Have you tried doing npm i babel-register ?

babel-register is for babel 6 whereas @babel/register is for babel 7 AFAIK.

need to figure out which tool uses babel 6 (which in turn requires the old babel-register plugin)

@Geminii
Copy link
Author

Geminii commented Dec 10, 2019

Hi @vinayakkulkarni ,
Thanks for your answer.
I try babel-register for babel 6 and change nyc, ava, and babel configuration. But always the same result like i printed before :(

I don't understand why Istanbul detect this line ... a really mystery for me :/
If you have another idea ? Probably a problem of the configuration ? Or maybe i miss something ?

@Geminii
Copy link
Author

Geminii commented Dec 11, 2019

I try to continue to fix this problem and i found an answer :
When webpack uses inline-source-map, nyc don't works correctly..

I try many possibilities to fix this but no results :(
Do you have maybe a solution ?

Thanks :)
Regards.

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

2 participants