hey guys, i have a step in my bitbucket pipeline which runs SonarCloud analysis scan for my typescript project,
by the end of the pipeline run it shows SonarCloud analysis was successful, but sonarcloud dashbord always showing 0 coverage
the pipeline step-
- step:
name: Unit tests
caches:
- node-modules
- yarn
- sonar
script:
- cd next_app
- yarn install
- yarn jest --coverage
- pipe: sonarsource/sonarcloud-scan:1.2.1
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
my jest configuration on package.json-
“jest”: {
“testPathIgnorePatterns”: [
“/.next/”,
“/node_modules/”
],
“collectCoverage”: true,
“coverageDirectory”: “./coverage”,
“testResultsProcessor”: “jest-sonar-reporter”
},
sonar-project.properties file-
sonar.sources=.
sonar.tests=src
sonar.test.inclusions=’/testing/,/*.spec.ts,/*.spec.tsx’
sonar.typescript.lcov.reportPaths=./coverage/lcov.info
sonar.testExecutionReportPaths=./test-report.xml
any help will be much appreciated!