jhipster-vuejs icon indicating copy to clipboard operation
jhipster-vuejs copied to clipboard

Sonar analyze: component, update, details not covered

Open pascalgrimaud opened this issue 5 years ago • 10 comments

Overview of the issue

When launching Sonar Analyze, under Sonar, these files are not covered:

  • component.ts
  • update.component.ts
  • details.component.ts

When we use npm test, it seems to be covered

I'll update the template later if needed

Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)
JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • [ ] Checking this box is mandatory (this is just to show you read everything)

pascalgrimaud avatar Jul 25 '19 16:07 pascalgrimaud

I'm adding a bounty on this, as it is really important for us, in our current project with @nonomoho So if someone can help

pascalgrimaud avatar Jul 25 '19 16:07 pascalgrimaud

You mean the update and details components for entities, right? For me it looks like they are also not covered when doing npm test, although there is unit test for that.

image

atomfrede avatar Jul 26 '19 04:07 atomfrede

yes exactly @atomfrede it's for entities

but I remember I saw the same thing yesterday for health too:

  • health.service.ts is covered
  • health.component.ts not Both got spec.ts

pascalgrimaud avatar Jul 26 '19 04:07 pascalgrimaud

Yes. .component.ts are nowhere to find in the coverage reports also there is a spec for that which is executed. Very strange indeed.

atomfrede avatar Jul 26 '19 05:07 atomfrede

You can find their coverage under corresponding .vue files like user-management-edit.vue contains the coverage of JhiUserManagementEdit.

vishal423 avatar Jul 26 '19 07:07 vishal423

I think it's related to https://github.com/SonarSource/SonarTS/issues/477

vishal423 avatar Jul 26 '19 08:07 vishal423

Oh thanks @vishal423 We can see @sahbi-ktifa already answered to the ticket lol

pascalgrimaud avatar Jul 26 '19 08:07 pascalgrimaud

In a project I'm working on we use only .vue files without distinct .component.ts files. And our sonar analysis has the correct coverage information.

Could we consider to use only .vue files to fix this issue ?

stonedMoose avatar Mar 02 '20 07:03 stonedMoose

Using only .vue file for fixing this Sonar Analyze is not a good idea. We split into TS file, to be consistent with Angular part, and it will probably help to migrate to Vue 3.

There is already an opened ticket for that: https://jira.sonarsource.com/browse/MMF-1441 So the real issue is on their side.

pascalgrimaud avatar Mar 02 '20 07:03 pascalgrimaud

Using only .vue file for fixing this Sonar Analyze is not a good idea. We split into TS file, to be consistent with Angular part, and it will probably help to migrate to Vue 3.

There is already an opened ticket for that: https://jira.sonarsource.com/browse/MMF-1441 So the real issue is on their side.

@pascalgrimaud it seems that it is not a priority for them :(

qmonmert avatar Aug 05 '20 14:08 qmonmert