Files
ISA-Frontend/karma.conf.js
2023-01-11 15:55:40 +01:00

59 lines
1.8 KiB
JavaScript

// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
const testParamIndex = process.argv.findIndex((arg) => arg === 'test');
let project = process.argv[testParamIndex + 1];
project = project.replace('@', '').replace('/', '-');
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'),
require('karma-junit-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true, // removes the duplicated traces
},
reporters: ['progress', 'junit', 'kjhtml'],
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
coverageReporter: {
dir: require('path').join(__dirname, 'coverage', project),
subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }, { type: 'cobertura', file: 'cobertura.xml' }],
// include all files
includeAllSources: true,
},
junitReporter: {
outputDir: require('path').join(__dirname, 'testresults', project),
suite: project,
useBrowserName: false,
properties: {
'project.name': project,
},
},
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
files: [{ pattern: 'karma/assets/**/*', watched: false, included: false, served: true, nocache: false }],
});
};