From ebb34b5ea855913dfc90e6faac7c1ff0a90c02c7 Mon Sep 17 00:00:00 2001 From: Henry Taeschner Date: Wed, 10 Jan 2024 14:39:50 +0100 Subject: [PATCH] fix: adjust karma/sonar config --- karma.conf.js | 6 +++--- package.json | 4 ++-- sonar-local-project.properties | 3 ++- sonar-project.properties | 11 +++++++++++ 4 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 sonar-project.properties diff --git a/karma.conf.js b/karma.conf.js index fcdd1d0..813dc58 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,7 +3,7 @@ module.exports = function (config) { config.set({ - basePath: '', + basePath: '.', logLevel: config.LOG_INFO, frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ @@ -44,8 +44,8 @@ module.exports = function (config) { coverageReporter: { includeAllSources: true, dir: 'reports', - subdir: 'coverage', - reporters: [{ type: 'html' }, { type: 'text-summary' }] + subdir: 'coverage', // common name instaed browser-specific + reporters: [{ type: 'text-summary' }, { type: 'lcov' }] }, reporters: ['progress', 'kjhtml', 'coverage', 'sonarqubeUnit'], preprocessors: { 'src/**/*.js': ['coverage'] }, diff --git a/package.json b/package.json index 6363c00..38e7538 100644 --- a/package.json +++ b/package.json @@ -139,10 +139,10 @@ "msw-storybook-addon": "^1.8.0", "ng-packagr": "15.2.2", "ngx-build-plus": "^14.0.0", - "ngx-translate-testing": "^6.1.0", + "ngx-translate-testing": "^7.0.0", "postcss": "8.4.23", "postcss-import": "~15.1.0", - "postcss-preset-env": "~8.3.2", + "postcss-preset-env": "~9.3.0", "postcss-url": "~10.1.3", "prettier": "^2.8.8", "sonarqube-scanner": "^3.3.0", diff --git a/sonar-local-project.properties b/sonar-local-project.properties index c8e1694..f10f469 100644 --- a/sonar-local-project.properties +++ b/sonar-local-project.properties @@ -12,7 +12,8 @@ sonar.testExecutionReportPaths=reports/sonarqube_report.xml sonar.sourceEncoding=UTF-8 sonar.sources=src/app sonar.working.directory=dist/sonar -sonar.coverage.exclusions=*.js,src/*,src/test/*,src/environments/*,src/assets/**/*,src/app/generated/**/* +sonar.coverage.exclusions=node_modules/**,src/**/*.module.ts,src/environments/*,src/assets/**/*,src/app/generated/**/*,src/test/* sonar.exclusions=node_modules/** +sonar.cpd.exclusions=node_modules/**,src/**/*.html sonar.tests=src/app sonar.test.inclusions=src/app/**/*.spec.ts \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..d8af502 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.javascript.coveragePlugin=lcov +sonar.javascript.lcov.reportPaths=reports/coverage/lcov.info +sonar.testExecutionReportPaths=reports/sonarqube_report.xml +sonar.sourceEncoding=UTF-8 +sonar.sources=src/app +sonar.working.directory=dist/sonar +sonar.coverage.exclusions=node_modules/**,src/**/*.module.ts,src/environments/*,src/assets/**/*,src/app/generated/**/*,src/test/* +sonar.exclusions=node_modules/**,src/**/*.html +sonar.cpd.exclusions=node_modules/**,src/**/*.html +sonar.tests=src/app +sonar.test.inclusions=src/app/**/*.spec.ts \ No newline at end of file