Skip to content

Commit 70267e4

Browse files
committed
test: karma config for ChromeHeadless
1 parent e0ffe5f commit 70267e4

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"build-lib:dev": "ng build @coreui/angular --watch",
2121
"build-lib:prod": "ng build @coreui/angular --prod",
2222
"test-lib:dev": "ng test @coreui/angular",
23-
"test-lib:prod": "ng test @coreui/angular --watch=false",
23+
"test-lib:prod": "ng test @coreui/angular --karmaConfig=projects/coreui/angular/karma.conf.github.js",
2424
"start": "ng serve",
2525
"test": "ng test",
2626
"lint": "ng lint",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
dir: require('path').join(__dirname, '../../../coverage/coreui/angular'),
20+
reports: ['html', 'lcovonly', 'text-summary'],
21+
fixWebpackSourcePaths: true
22+
},
23+
reporters: ['progress', 'kjhtml'],
24+
port: 9876,
25+
colors: true,
26+
logLevel: config.LOG_INFO,
27+
autoWatch: false,
28+
singleRun: true,
29+
restartOnFileChange: false,
30+
browsers: ['ChromeHeadless'],
31+
});
32+
};

0 commit comments

Comments
 (0)