-
Notifications
You must be signed in to change notification settings - Fork 2
/
karma.conf.js
89 lines (85 loc) · 2.06 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
const sauceLabs = process.env.SL;
const sauceLabsLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Windows 10'
},
sl_safari: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11'
},
sl_edge: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10'
},
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '11.103',
platform: 'Windows 10'
},
sl_ie_10: {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '10.0',
platform: 'Windows 7'
},
sl_ie_9: {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '9.0',
platform: 'Windows 7'
}
};
module.exports = function (config) {
config.set({
browsers: sauceLabs ? Object.keys(sauceLabsLaunchers) : ['PhantomJS'],
browserNoActivityTimeout: 30000,
files: [
{pattern: 'src/index.js', included: true, watched: true},
{pattern: 'test/**/*.spec.js', watched: true}
],
frameworks: ['browserify', 'jasmine'],
preprocessors: {
'src/**/*.js': ['browserify'],
'test/**/*spec.js': ['browserify']
},
browserify: {
transform: [
['babelify'],
['browserify-istanbul', {
instrumenterConfig: {
embedSource: true // this is important for HTML reports
}
}]
]
},
sauceLabs: {
testName: 'Unit Tests',
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
startConnect: false,
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY
},
reporters: ['progress'].concat(
sauceLabs ? 'saucelabs' : 'coverage'
),
coverageReporter: {
dir: './coverage',
reporters: [
{type: 'text-summary'},
{type: 'html'},
{type: 'lcovonly', subdir: '.', file: 'lcov.info'}
]
},
customLaunchers: sauceLabs ? sauceLabsLaunchers : null
});
};