Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ testem.log
# System Files
.DS_Store
Thumbs.db

# App files
/reports/
/build/
3 changes: 2 additions & 1 deletion ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"styles": [
"src/styles.css"
],
"scripts": []
"scripts": [],
"codeCoverage": true
}
},
"lint": {
Expand Down
37 changes: 23 additions & 14 deletions ui/karma.ci.conf.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
// karma.conf.js
'use strict';

var path = require('path');

module.exports = function(config) {
config.set({
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('karma-junit-reporter'),
require('karma-coverage'),
require('karma-sonarqube-unit-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
files: ['src/app/**/*.spec.ts'],
reporters: ['progress', 'junit'],
reporters: ['progress', 'sonarqubeUnit', 'coverage'],
port: 9876, // karma web server port
colors: true,
logLevel: config.LOG_INFO,
Expand All @@ -22,19 +25,25 @@ module.exports = function(config) {
flags: ['--no-sandbox']
}
},
junitReporter: {
outputDir: 'test-results/', // results will be saved as $outputDir/$browserName.xml
outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: 'client', // suite will become the package name attribute in xml testsuite element
useBrowserName: true, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {}, // key value pair of properties to add to the <properties> section of the report
xmlVersion: null // use '1' if reporting to be per SonarQube 6.2 XML format
coverageReporter: {
reporters: [
{
type: 'lcov',
dir: 'reports',
subdir: 'coverage',
},
{
type: 'text-summary'
},
]
},
sonarQubeUnitReporter: {
sonarQubeVersion: 'LATEST',
outputFile: 'reports/ut_report.xml',
useBrowserName: false
},
autoWatch: false,
singleRun: true, // Karma captures browsers, runs the tests and exits
concurrency: Infinity
})
}

22 changes: 14 additions & 8 deletions ui/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,35 @@

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('karma-coverage'),
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/ui'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
coverageReporter: {
reporters: [
{
type: 'lcov',
dir: 'reports',
subdir: 'coverage',
},
{
type: 'text-summary'
}
]
},
reporters: ['progress', 'kjhtml'],
reporters: ['progress', 'coverage', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
autoWatch: true,
singleRun: false,
restartOnFileChange: true
});
Expand Down
Loading