-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathkarma.conf.js
143 lines (120 loc) · 3.34 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
const TRAVIS_WITH_BS = !!process.env.BROWSER_STACK_ACCESS_KEY
const launchers = {
bs_chrome: {
base: 'BrowserStack',
browser: 'chrome',
os: 'Windows',
os_version: '10'
},
bs_firefox: {
base: 'BrowserStack',
browser: 'firefox',
os: 'Windows',
os_version: '10'
},
bs_safari: {
base: 'BrowserStack',
browser: 'Safari',
os: 'OS X',
os_version: 'Big Sur'
},
bs_ie: {
base: 'BrowserStack',
browser: 'IE',
browser_version: '11.0',
os: 'Windows',
os_version: '10'
},
bs_ie9: {
base: 'BrowserStack',
browser: 'IE',
browser_version: '9.0',
os: 'Windows',
os_version: '7'
}
}
let browsers = ['Chrome']
if (process.env.TRAVIS) {
if (TRAVIS_WITH_BS) {
browsers = Object.keys(launchers)
}
}
module.exports = function (config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '../..',
frameworks: ['browserify', 'mocha'],
// list of files / patterns to load in the browser
files: [
'test/client/*.js'
],
// list of files to exclude
exclude: [
],
preprocessors: {
'test/client/*.js': ['browserify']
},
// use dots reporter, as travis terminal does not support escaping sequences
// possible values: 'dots', 'progress'
// CLI --reporters progress
reporters: ['dots'],
junitReporter: {
// will be resolved to basePath (in the same way as files/exclude patterns)
outputFile: 'test-results.xml'
},
// web server port
// CLI --port 9876
port: 9876,
// enable / disable colors in the output (reporters and logs)
// CLI --colors --no-colors
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
// CLI --log-level debug
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
// CLI --auto-watch --no-auto-watch
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
// CLI --browsers Chrome,Firefox,Safari
browsers: browsers,
customLaunchers: launchers,
// Recommeneded browserstack timeouts
// https://github.com/karma-runner/karma-browserstack-launcher/issues/61
captureTimeout: 3e5,
browserDisconnectTolerance: 3,
browserDisconnectTimeout: 3e5,
browserSocketTimeout: 1.2e5,
browserNoActivityTimeout: 3e5,
// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: true,
// report which specs are slower than 500ms
// CLI --report-slower-than 500
reportSlowerThan: 500,
plugins: [
'karma-mocha',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-junit-reporter',
'karma-browserify',
'karma-browserstack-launcher'
],
concurrency: 3,
forceJSONP: true,
browserStack: {
project: 'Karma',
// The karma-browserstack-launcher polls for each browser.
// With many browsers the 120 requests per minute limit is hit
// resulting in fails Error: 403 Forbidden (Rate Limit Exceeded)
pollingTimeout: 10000
}
})
}