Cannot get coverage on Vue props default lines

We are working through our code smells after setting up sonar.

Its going well except we have to cover (with unit tests) any changes we do.

We are creating unit tests as we go. However for some it seems impossible to cover. ie we have only changed 3 lines in a file, so 100% uncovered but there doesn’t seem to be a way to cover them.

Is there a work around for these issues?

Hey there.

Is the coverage report you’re producing reporting these lines as uncovered? If that’s the case – you should go back to your coverage tool and understand why. SonarQube only reads coverage reports, it doesn’t produce them.

I also found this answer on StackOverflow

1 Like

Its does but I was wondering if there was a way to exclude a props default value from being required?

That’s really a question for the coverage tool you’re using. Otherwise, SonarCloud will let you exclude entire files from coverage calculation.