Appearance
JavaScript Code Coverage
Code Quality (Embold) enables users to include coverage data as part of the analysis for JavaScript projects. However, Code Quality itself does not generate coverage reports. To incorporate coverage information, users must first use a third- party tool to create the coverage report. Once the report is ready, users need to configure Code Quality to locate and retrieve it. This ensures that the coverage data is displayed alongside other analysis results within the Code Quality UI.
Pre-requisites:
- The Code Quality (Embold) Server must be running and properly configured. (version 1.9.26.4 or later)
- The user needs to have a build for their Javascript project, which includes coverage data as part of the test runs.
- The user should run the Code Quality scan on the same host where the Javascript project was built and the coverage data was generated.
- The reports should be in LCOV format.
Running Remote Scan for Coverage
To include JavaScript coverage data in your analysis, run a remote scan using the CLI scanner. Full setup and execution instructions are in the Remote Scan (CLI Analysis) guide.
Coverage-specific config: In your
repository-configuration.json, theIstanbulmodule is enabled by default andreportDirdefaults tobaseDir. To use a different location for your LCOV reports, setreportDirto the parent directory of the report files.
Once the scan completes, navigate to the Coverage section in the Code Quality UI to view the results.
Running Coverage in CI/CD
To automate coverage analysis as part of your pipeline (GitHub Actions, Azure DevOps, Jenkins, GitLab CI, etc.), see the CI/CD Integration guide.
