mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
* fix: enable LCOV coverage reporting for SonarCloud Add lcov reporter to all karma configs, upload coverage artifacts from unit test matrix jobs, and add a SonarCloud scan job that merges coverage reports and runs the sonar-scanner with proper LCOV paths. Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: pass secrets to unit-test-workflow and set SONAR_HOST_URL for SonarCloud Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> * fix: add test outputs to nx.json so NX caches and restores coverage reports Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> * test: add unit tests for Chart model to verify coverage reporting * fix: use find to locate lcov.info in downloaded artifacts for SonarCloud coverage Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> * test: add fake file with unit test to verify coverage reporting Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> * ci: add full SonarCloud scan workflow on develop push Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> * test: remove fake coverage-canary file and its spec Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> * fix: replace secrets inherit with explicit SONAR_TOKEN in workflow call Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
50 lines
1.8 KiB
JavaScript
50 lines
1.8 KiB
JavaScript
// Karma configuration file, see link for more information
|
|
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
/* eslint-env es6 */
|
|
const { join } = require('path');
|
|
const { constants } = require('karma');
|
|
|
|
module.exports = function (config) {
|
|
config.set({
|
|
basePath: '',
|
|
files: [
|
|
{ pattern: '../../node_modules/pdfjs-dist/build/pdf.min.mjs', type: 'module', included: true, watched: false },
|
|
{ pattern: '../../node_modules/pdfjs-dist/build/pdf.worker.min.mjs', type: 'module', included: true, watched: false }
|
|
],
|
|
frameworks: ['jasmine'],
|
|
plugins: [require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage')],
|
|
client: {
|
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
},
|
|
jasmineHtmlReporter: {
|
|
suppressAll: true // removes the duplicated traces
|
|
},
|
|
|
|
coverageReporter: {
|
|
dir: join(__dirname, '../../coverage/extensions'),
|
|
subdir: '.',
|
|
reporters: [{ type: 'html' }, { type: 'lcov' }, { type: 'text-summary' }, { type: 'text-summary', subdir: '.', file: 'summary.txt' }],
|
|
check: {
|
|
global: {
|
|
statements: 75,
|
|
branches: 65,
|
|
functions: 73,
|
|
lines: 75
|
|
}
|
|
}
|
|
},
|
|
reporters: ['progress', 'kjhtml'],
|
|
port: 9876,
|
|
colors: true,
|
|
logLevel: constants.LOG_INFO,
|
|
browsers: ['ChromeHeadless'],
|
|
customLaunchers: {
|
|
ChromeHeadless: {
|
|
base: 'Chrome',
|
|
flags: ['--no-sandbox', '--headless', '--disable-gpu', '--remote-debugging-port=9222']
|
|
}
|
|
},
|
|
singleRun: true
|
|
});
|
|
};
|