-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
139 lines (122 loc) · 3.61 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
var clone= require('clone');
var paths = require('./build/paths');
var webpackConfig = clone(require('./webpack.config.js'));
// Add istanbul-instrumenter to webpack configuration
webpackConfig.module.loaders.push(
{
test: /\.js$/,
exclude: /(node_modules|test)/,
loader: 'babel-istanbul-loader'
}
);
webpackConfig.output.filename += '.test';
webpackConfig.plugins = [];
webpackConfig.externals = [];
function ConfigException(message) {
this.message = message;
this.name = 'ConfigException';
}
// The main configuration
module.exports = function(config) {
if (process.env.CI && (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY)) {
throw ConfigException('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.')
}
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
var customLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10',
version: 'latest'
},
sl_chrome_2: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10',
version: 'latest-1'
},
sl_edge: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: 'latest'
},
sl_edge_2: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '14.14393'
},
sl_safari: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'macOS 10.12',
version: 'latest'
},
sl_safari_2: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11',
version: '9.0'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Windows 10',
version: 'latest'
},
sl_firefox_2: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Windows 10',
version: 'latest-1'
},
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
}
}
config.set({
coverageReporter: {
reporters: [
{ type: 'lcov', dir: paths.coverageDir },
{ type: 'text' }
]
},
files: [
'test/*.spec.js'
],
frameworks: [
'jasmine-jquery',
'jasmine'
],
preprocessors: {
'test/*.spec.js': [
'webpack'
]
},
sauceLabs: {
build: 'process.env.TRAVIS_BUILD_NUMBER',
testName: 'BEM.js browser testing',
logfile: './saucelabs.log',
public: 'public',
tunnelIdentifier: 'autoGeneratedTunnelID',
docktor: true
},
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
},
browserNoActivityTimeout: 200000,
captureTimeout: 200000,
colors: true,
concurrency: 5,
customLaunchers: customLaunchers,
retryLimit: 5,
singleRun: false,
browsers: (process.env.TRAVIS) ? Object.keys(customLaunchers) : ['Chrome', 'Firefox'],
reporters: (process.env.TRAVIS) ? ['spec', 'coverage', 'saucelabs', 'coveralls'] : ['spec', 'coverage']
});
}