-
Notifications
You must be signed in to change notification settings - Fork 223
/
karma.conf.js
259 lines (231 loc) · 7.74 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
'use strict';
/* jshint node:true */
function filterBrowsers (browsers, re) {
return Object.keys(browsers).filter(function (key) {
return re.test(key);
});
}
module.exports = function (config) {
var isCI = (Boolean(process.env.CI) && Boolean(process.env.BROWSER_STACK_ACCESS_KEY)) === true;
var browsers = process.env.BROWSERS ? process.env.BROWSERS.split(',') : null;
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// frameworks to use
frameworks: ['mocha', 'expect', 'sinon'],
// list of files / patterns to load in the browser
files: [
'node_modules/jquery/dist/jquery.min.js',
'test/fixtures/jquery-noconflict.js',
'test/fixtures/*.html',
'Imager.js',
'test/*.js',
'test/unit/**/*.js',
{ 'pattern': 'Demo - Grunt/Assets/Images/**/*.jpg', 'included': false, 'served': true },
{ 'pattern': 'test/fixtures/**/*.jpg', 'included': false, 'served': true },
{ 'pattern': 'test/fixtures/oldformat/*', 'included': false, 'served': true }
],
preprocessors: {
'**/*.html': ['html2js']
},
// list of files to exclude
exclude: [
],
// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['progress'],
// essential for non xhr2 browsers
transports: ['polling'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
browserStack: {
project: 'BBC-News/Imager.js',
build: process.env.CONTINUOUS_INTEGRATION ? null : ('Local testing - ' + Date.now())
},
customLaunchers: {
'PhantomJSCustom': {
base: 'PhantomJS',
options: {
viewportSize: {
width: 1024,
height: 768
}
}
},
// Browserstack
// BSIE6: {
// base: 'BrowserStack',
// browser: 'ie',
// browser_version: '6.0',
// os: 'Windows',
// os_version: 'XP'
// },
BSIE7: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '7.0',
os: 'Windows',
os_version: 'XP'
},
BSIE8: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '8.0',
os: 'Windows',
os_version: '7'
},
BSIE9: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '9.0',
os: 'Windows',
os_version: '7'
},
BSIE10: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '10.0',
os: 'Windows',
os_version: '8'
},
BSIE11: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11.0',
os: 'Windows',
os_version: '8.1'
},
BSEDGE12: {
base: 'BrowserStack',
browser: 'edge',
browser_version: '12.0',
os: 'Windows',
os_version: '10'
},
BSOS4: {
base: 'BrowserStack',
device: 'iPhone 4',
os: 'ios',
os_version: '4.0'
},
BSOS5: {
base: 'BrowserStack',
device: 'iPhone 4S',
os: 'ios',
os_version: '5.1'
},
BSOS6: {
base: 'BrowserStack',
device: 'iPhone 5',
os: 'ios',
os_version: '6.0'
},
BSOS7: {
base: 'BrowserStack',
device: 'iPad 4th',
os: 'ios',
os_version: '7.0'
},
BSOS8: {
base: 'BrowserStack',
device: 'iPhone 6',
os: 'ios',
os_version: '8.3'
},
BSAndroid2: {
base: 'BrowserStack',
device: 'Samsung Galaxy S II',
browser: 'android',
os: 'android',
os_version: '2.3'
},
BSAndroid4: {
base: 'BrowserStack',
device: 'Samsung Galaxy Nexus',
browser: 'android',
os: 'android',
os_version: '4.0'
},
BSAndroid5: {
base: 'BrowserStack',
device: 'Google Nexus 5',
browser: 'android',
os: 'android',
os_version: '5.0'
},
BSFirefox: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: '22.0',
os: 'Windows',
os_version: '7'
},
BSChrome: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: '33',
os: 'OS X',
os_version: 'Yosemite'
},
BSOpera: {
base: 'BrowserStack',
browser: 'opera',
browser_version: '12.15',
os: 'OS X',
os_version: 'Yosemite'
},
BSSafari5: {
base: 'BrowserStack',
browser: 'safari',
browser_version: '5.1',
os: 'OS X',
os_version: 'Snow Leopard'
},
BSSafari6: {
base: 'BrowserStack',
browser: 'safari',
browser_version: '6.1',
os: 'OS X',
os_version: 'Mountain Lion'
},
BSSafari7: {
base: 'BrowserStack',
browser: 'safari',
browser_version: '7.0',
os: 'OS X',
os_version: 'Mavericks'
},
BSSafari8: {
base: 'BrowserStack',
browser: 'safari',
browser_version: '8.0',
os: 'OS X',
os_version: 'Yosemite'
},
BSSafari9: {
base: 'BrowserStack',
browser: 'safari',
browser_version: '9.0',
os: 'OS X',
os_version: 'El Capitan'
}
},
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: true,
browserNoActivityTimeout: 45000,
captureTimeout: isCI ? 120000 : 5000
});
config.set({
browsers: browsers || (isCI
? filterBrowsers(config.customLaunchers, /^BS/)
: ['PhantomJSCustom'])
});
};