forked from chpladmin/chpl-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
57 lines (55 loc) · 1.73 KB
/
karma.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
'use strict';
process.env.CHROME_BIN = require('puppeteer').executablePath()
let webpack = require('./webpack.config');
module.exports = config => {
config.set({
autoWatchBatchDelay: 3000,
browsers: config.ahrq ? ['ChromeHeadlessNoSandbox'] : ['ChromeHeadless'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
failOnEmptyTestSuite: false,
files: [
{ pattern: 'src/app/specs.js' }
],
frameworks: ['jasmine'],
preprocessors: {
'src/app/specs.js': ['webpack', 'sourcemap'],
},
reporters: config.useSpecReporter ? ['html', 'junit', 'spec', 'coverage-istanbul'] : ['html', 'junit', 'super-dots', 'coverage-istanbul'],
junitReporter: {
outputDir: 'test_reports',
suite: 'unit',
},
htmlReporter: {
groupSuites: true,
outputFile: 'test_reports/units.html',
useCompactStyle: true,
},
superDotsReporter: {
nbDotsPerLine: 100,
color: {
success: 'green',
failure: 'red',
ignore: 'grey',
},
icon: config.ahrq ? {
success : '.',
failure : 'X',
ignore : 'i',
} : {
success : '✔',
failure : '✖',
ignore : 'i',
},
},
coverageIstanbulReporter: {
dir: 'test_reports/coverage/',
reports: ['html', 'lcov', 'text-summary'],
},
webpack: webpack({NODE_ENV: 'development'}),
});
};