When testing locally we have 42% coverage. However sonar only says 30%. I have be setting one folder as the source at a time to see what happens to the coverage.
For example I have only set ‘pages’ which locally has nearly 90% coverage. However Sonar is reporting only 13%.
sonar.coverage.exclusions=dist/**/*,proto/**/* and so on.
The documentation on analysis scope gives a pretty thorough, if not lengthy, description of all the ways to adjust analysis scope, as well as an overview of glob patterns at the bottom of the page.
Thanks - it is pretty tricky figuring out which params can take globs or not.
Either way adding the above made no difference to the coverage value.
Looking at the output I can see this issue which suggests some tests are being ignored?
INFO: Test execution data ignored for 23 unknown files, including:
/opt/atlassian/pipelines/agent/build/components/__tests__/RegistrationFields.spec.ts
/opt/atlassian/pipelines/agent/build/pages/__tests__/registrationFormP1.spec.ts
/opt/atlassian/pipelines/agent/build/pages/__tests__/registrationFormP2.spec.ts
/opt/atlassian/pipelines/agent/build/pages/__tests__/institutionRegisterButtons.spec.ts
/opt/atlassian/pipelines/agent/build/components/__tests__/LogoItem.spec.ts```