当我运行 ng test --code-coverage,然后运行 sonar-scanner 时,仍然无法在声纳服务器上看到覆盖率报告。
我尝试使用 Angular 13 设置新项目并按照官方文档进行设置。还是没有运气。
我的声纳服务器版本:版本9.2.1(内部版本49989)
我的声纳扫描仪版本:4.7
我的 Karma 配置
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
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/lcov'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true, …Run Code Online (Sandbox Code Playgroud)