-
Notifications
You must be signed in to change notification settings - Fork 2
/
karma.conf.js
64 lines (61 loc) · 1.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
const webpack = require('webpack')
const sauceLaunchers = require('./sauceLaunchers.config')
let browsers
if (process.env.TRAVIS) {
// Travis only comes with Firefox
browsers = ['Firefox']
} else if (process.env.SAUCE) {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.error(
'SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables must be set!'
)
process.exit(1)
}
browsers = Object.keys(sauceLaunchers)
} else {
browsers = ['Chrome']
}
module.exports = function (config) {
const ci = process.env.CI
const sauce = process.env.SAUCE
config.set({
singleRun: true,
frameworks: ['jasmine'],
files: ['stylesheets/minimal.css', 'test/acceptance/tests.js'],
preprocessors: {
'test/acceptance/tests.js': ['webpack', 'sourcemap'],
},
reporters: ['dots', 'saucelabs'],
webpack: {
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel-loader'],
exclude: /node_modules/,
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
WATCH: process.env.WATCH,
},
}),
],
devtool: 'inline-source-map',
},
webpackMiddleware: {
stats: 'errors-only',
},
sauceLabs: {
testName: ci ? 'Rollex acceptance tests (CI)' : 'Rollex acceptance tests',
},
browsers,
concurrency: ci || sauce ? 2 : Infinity,
captureTimeout: 300000,
browserNoActivityTimeout: 300000,
customLaunchers: sauceLaunchers,
})
}