# Can't exclude folders from coverage report

**URL:** <https://community.sonarsource.com/t/cant-exclude-folders-from-coverage-report/63780>\
**Category:** SonarQube Cloud\
**Tags:** coverage\
**Created:** [May 24, 2022, 12:35pm UTC](https://community.sonarsource.com/t/cant-exclude-folders-from-coverage-report/63780 "2022-05-24T12:35:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DpcJynk](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dpcjynk/32/29110_2.png) [@DpcJynk](https://community.sonarsource.com/u/DpcJynk)\
**Post date:** [May 24, 2022, 12:35pm UTC](https://community.sonarsource.com/t/cant-exclude-folders-from-coverage-report/63780/1 "2022-05-24T12:35:51Z")

</div>

We have a nuxt projects with jest installed.

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%.

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/4/a/4ae534f2588372a27f4b2f557aa634831406ccc9.png)

Here is our sonar-project.properties file:

```auto
sonar.sourceEncoding=UTF-8
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.testExecutionReportPaths=coverage/test-reporter.xml
sonar.typescript.tsconfigPath=tsconfig.json
sonar.sources=pages
sonar.test.exclusions=pages/ __tests__
sonar.coverage.exclusions=dist,types,proto,proto-files,static,coverage,pages/ __tests__ /,pages/ __tests__
sonar.language=js
sonar.tests=**/*.spec.ts
sonar.test.inclusions=**/*.spec.ts
sonar.typescript.lcov.reportPaths=coverage/lcov.info

```

I feel like I’m missing something obvious but not sure how to see what is being included / excluded by sonar cloud’s coverage.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [May 24, 2022, 2:44pm UTC](https://community.sonarsource.com/t/cant-exclude-folders-from-coverage-report/63780/2 "2022-05-24T14:44:49Z")

</div>

Hey there

> [@DpcJynk](#):
>
> ```auto
> sonar.coverage.exclusions=dist,types,proto,proto-files,static,coverage,pages/ __tests__ /,pages/ __tests__
> 
> ```

You need to be using glob patterns. For example:

`sonar.coverage.exclusions=dist/ **/*,proto/** /*` and so on.

The documentation on [analysis scope](https://docs.sonarcloud.io/advanced-setup/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.

---

<div class="post-metadata">

**Author:** ![DpcJynk](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dpcjynk/32/29110_2.png) [@DpcJynk](https://community.sonarsource.com/u/DpcJynk)\
**Post date:** [May 24, 2022, 2:56pm UTC](https://community.sonarsource.com/t/cant-exclude-folders-from-coverage-report/63780/3 "2022-05-24T14:56:38Z")

</div>

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?

````auto
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```
````
