-
Notifications
You must be signed in to change notification settings - Fork 2
/
karma.conf.js
118 lines (96 loc) · 2.29 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
const os = require('os'),
WorkerPlugin = require('worker-plugin');
const SEC = 1000,
MIN = 60*SEC,
HOUR = 60*MIN;
const browsers = [
'FirefoxHeadless',
'ChromeHeadless'
];
const tested_files = [
'src/**/*_test.js',
];
const reporters = [
// 'spec'
// 'progress'
'progress-bar'
];
const nExecutors = Math.min( browsers.some(b => b.includes('Firefox')) ? 12 : 24, // <- Firefox can't seem handle more than 12
Math.max( 1, Math.floor(os.cpus().length / browsers.length) - 1 ));
module.exports = config => {
config.set({
basePath: '',
frameworks: [
'parallel',
'jasmine'
],
// browserDisconnectTolerance: 10*SEC,
browserDisconnectTimeout: 5*MIN,
browserNoActivityTimeout: 5*MIN,
browserSocketTimeout: 5*MIN,
processKillTimeout: 5*MIN,
// captureTimeout: 1*HOUR,
autoWatch: false,
// reportSlowerThan: 5*SEC,
plugins: [
'karma-parallel',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-jasmine',
'karma-webpack',
'karma-spec-reporter',
'karma-sourcemap-loader',
require('./progress_bar_reporter')
],
parallelOptions: {
executors: nExecutors,
// shardStrategy: 'round-robin'
},
client: {
jasmine: {
random: false,
// random: true,
// failFast: true,
oneFailurePerSpec: true,
stopSpecOnExpectationFailure: true,
timeoutInterval: 8*HOUR,
defaultTimeoutInterval: 8*HOUR,
DEFAULT_TIMEOUT_INTERVAL: 8*HOUR
}
},
webpack: {
mode: 'development',
devtool: 'inline-source-map',
plugins: [
new WorkerPlugin({
globalObject: 'this'
})
]
},
files: tested_files,
exclude: [
],
preprocessors: {
'src/**/*.js': ['webpack', 'sourcemap']
},
reporters,
specReporter: {
showSpecTiming: true
},
customLaunchers: {
MyChromeHeadless: {
base: "ChromeHeadless",
flags: [
"--js-flags=\"--max_old_space_size=2048 --max_semi_space_size=1024\""
]
}
},
browsers,
port: 9876,
logLevel: config.LOG_INFO,
autoWatch: true,
singleRun: true,
concurrency: Infinity,
colors: true
})
}