Sonar cloud scanner fail to capture the codecoverage for the nextjs react code

Great, thanks for the details, it’s much clearer to me now :slight_smile:

I guess that the following will help you:

  • You must make sure that the execution of your unit test produces an LCOV report file
  • You need to configure the “Prepare analysis” step with the following additional parameter: sonar.javascript.lcov.reportPaths
    • This is a comma-separated list of paths to LCOV coverage report files

And with this, you should get the coverage in SonarCloud.

1 Like