Skip to content

Commit

Permalink
fix: adjust karma/sonar config
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG committed Jan 10, 2024
1 parent 9e0e7c9 commit ebb34b5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
6 changes: 3 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module.exports = function (config) {
config.set({
basePath: '',
basePath: '.',
logLevel: config.LOG_INFO,
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Expand Down Expand Up @@ -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'] },
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion sonar-local-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ebb34b5

Please sign in to comment.