Not able get code coverage in Sonarqube in Angular Project Using Jenkins Pipeline

We are using jenkins Pipeline for our Application, but we are unable to get code coverage for our Application in Sonarqube can any one help ?

Jenkins :

node('cicd-build') {
    try {
        stage("Checkout") {
            scmCheckout {
              node_version = "Nodejs 16"
            }
        }

        stage("Build") {
            env.SASS_BINARY_SITE = 'https://ci-repo.aexp.com/repository/github-node-sass/download'
            env.PHANTOMJS_CDNURL = 'https://ci-repo.aexp.com/nodejs/content/sites/npm-remotes/ariya/phantomjs/downloads/'
            env.NODEJS_ORG_MIRROR = 'https://ci-repo.aexp.com/repository/nodejs-proxy/'
            npmUtils.npm "ci"
            npmUtils.npm "test"
            npmUtils.npm "run build"
        }

        stage("Scan") {
                sonarscanonly {
                    language="js"
                }
         }

Karma.conf.js

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine','@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular-devkit/build-angular/plugins/karma')
    ],
    client:{
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    coverageIstanbulReporter: {
      dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
      fixWebpackSourcePaths: true
    },
    angularCli: {
      environment: 'dev'
    },
    reporters: ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    autoWatchBatchDelay:500,
    browsers: ['Chrome'],
    singleRun: false
  });
};

Sonar-project.properties


sonar.exclusions=test/services/*.test.js,test/*.test.js , **/*.js.flow
sonar.c.file.suffixes=**/*.c
sonar.cpp.file.suffixes=**/*.cpp
sonar.objc.file.suffixes=**/*.mm

Thanks

Hey there.

Have you read the documentation on Javascript/Typescript Test Coverage | SonarQube Docs?

Specifically, have you pointed the sonar.javascript.lcov.reportPaths analysis parameter to the lcov.info file you’re generating?