forked from madoar/angular-archwizard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.js
More file actions
66 lines (58 loc) · 1.83 KB
/
karma.conf.js
File metadata and controls
66 lines (58 loc) · 1.83 KB
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
58
59
60
61
62
63
64
65
66
// 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', 'detectBrowsers'],
plugins: [
'karma-jasmine',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-safari-launcher',
'karma-detect-browsers',
'karma-jasmine-html-reporter',
'karma-coverage-istanbul-reporter',
'@angular-devkit/build-angular/plugins/karma'
],
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true,
thresholds: {
statements: 80,
lines: 80,
branches: 80,
functions: 80
}
},
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
},
ChromiumHeadlessNoSandbox: {
base: 'ChromiumHeadless',
flags: ['--no-sandbox']
}
},
detectBrowsers: {
// enable/disable, default is true
enabled: true,
// enable/disable phantomjs support, default is true
usePhantomJS: false,
// use headless mode, for browsers that support it, default is false
preferHeadless: true,
postDetection: function (availableBrowsers) {
if (availableBrowsers.includes('ChromeHeadless')) {
const index = availableBrowsers.indexOf('ChromeHeadless');
availableBrowsers[index] = 'ChromeHeadlessNoSandbox';
}
if (availableBrowsers.includes('ChromiumHeadless')) {
const index = availableBrowsers.indexOf('ChromiumHeadless');
availableBrowsers[index] = 'ChromiumHeadlessNoSandbox';
}
return availableBrowsers;
}
},
singleRun: true
});
};