| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- // 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/fatboar-burger'),
- reports: ['html', 'lcovonly', 'text-summary', 'cobertura'], // Ajout du format cobertura pour Jenkins
- fixWebpackSourcePaths: true,
- // Seuils de couverture (optionnel - décommentez si vous voulez des seuils minimum)
- // thresholds: {
- // global: {
- // statements: 80,
- // branches: 75,
- // functions: 80,
- // lines: 80
- // }
- // }
- },
- reporters: ['progress', 'kjhtml', 'coverage-istanbul'], // Ajout du reporter coverage-istanbul
- port: 9876,
- colors: true,
- logLevel: config.LOG_INFO,
- autoWatch: false,
- browsers: ['ChromeHeadless'],
- singleRun: true,
- restartOnFileChange: false,
- // Ajouts pour éviter les déconnexions ChromeHeadless
- captureTimeout: 60000,
- browserDisconnectTimeout: 60000,
- browserDisconnectTolerance: 3,
- browserNoActivityTimeout: 60000,
- // Custom launcher configurations ajoutées pour Jenkins CI
- customLaunchers: {
- ChromeHeadlessCustom: {
- base: 'ChromeHeadless',
- flags: [
- '--no-sandbox',
- '--disable-web-security',
- '--disable-features=VizDisplayCompositor',
- '--disable-gpu',
- '--disable-canvas-aa',
- '--disable-3d-apis',
- '--disable-extensions',
- '--disable-dev-shm-usage',
- '--disable-translate',
- '--disable-logging',
- '--disable-background-timer-throttling',
- '--disable-backgrounding-occluded-windows',
- '--disable-renderer-backgrounding',
- '--remote-debugging-port=9222'
- ]
- },
- ChromeHeadlessCI: {
- base: 'ChromeHeadless',
- flags: [
- '--no-sandbox', // CRUCIAL pour Docker/Jenkins
- '--disable-web-security',
- '--disable-features=VizDisplayCompositor',
- '--disable-gpu',
- '--disable-canvas-aa',
- '--disable-3d-apis',
- '--disable-extensions',
- '--disable-dev-shm-usage', // Important pour les environnements Docker
- '--disable-translate',
- '--disable-logging',
- '--disable-background-timer-throttling',
- '--disable-backgrounding-occluded-windows',
- '--disable-renderer-backgrounding',
- '--headless',
- '--disable-ipc-flooding-protection',
- '--disable-hang-monitor',
- '--disable-prompt-on-repost',
- '--disable-default-apps'
- ]
- }
- }
- });
- };
|