-
Notifications
You must be signed in to change notification settings - Fork 7
/
karma.conf.js
85 lines (76 loc) · 2.18 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
var path = require('path')
process.env.KARMA = 'true'
var webpackConf = require('./webpack.config.js')
module.exports = function (config) {
var cfg =
{ browsers: ['Chrome', 'Firefox']
, files: ['./test/index.js']
, frameworks: ['chai', 'mocha']
, plugins:
[ 'karma-browserstack-launcher'
, 'karma-chrome-launcher'
, 'karma-chai'
, 'karma-firefox-launcher'
, 'karma-mocha'
, 'karma-mocha-reporter'
, 'karma-sourcemap-loader'
, 'karma-webpack'
]
, preprocessors:
{ 'test/index.js': ['webpack', 'sourcemap']
}
, reporters: ['mocha']
, singleRun: true
, webpack: webpackConf
, webpackMiddleware: { noInfo: true }
, browserDisconnectTimeout: 10*1000
, browserDisconnectTolerance: 1
, browserNoActivityTimeout: 60*1000
, captureTimeout: 2*60*1000
}
if (process.env.TRAVIS) {
cfg.customLaunchers =
{ Chrome_travis_ci:
{ base: 'Chrome'
, flags: ['--no-sandbox']
}
}
cfg.browsers = ['Chrome_travis_ci', 'Firefox']
}
// if (process.env.BROWSERSTACK_USERNAME && process.env.BROWSERSTACK_ACCESSKEY) {
// cfg.browserStack =
// { username: process.env.BROWSERSTACK_USERNAME
// , accessKey: process.env.BROWSERSTACK_ACCESSKEY
// }
// if (!cfg.customLaunchers) cfg.customLaunchers = {}
// cfg.customLaunchers.iOS8 =
// { base: 'BrowserStack'
// , device: 'iPhone 6'
// , os: 'ios'
// , os_version: '8.3'
// }
// cfg.browsers.push('iOS8')
// cfg.customLaunchers.iOS9 =
// { base: 'BrowserStack'
// , device: 'iPhone 6S'
// , os: 'ios'
// , os_version: '9.0'
// }
// cfg.browsers.push('iOS9')
// cfg.customLaunchers.Android4 =
// { base: 'BrowserStack'
// , device: 'Samsung Galaxy S5'
// , os: 'android'
// , os_version: '4.4'
// }
// cfg.browsers.push('Android4')
// // cfg.customLaunchers.Android5 =
// // { base: 'BrowserStack'
// // , device: 'Google Nexus 5'
// // , os: 'android'
// // , os_version: '5.0'
// // }
// // cfg.browsers.push('Android5')
// }
config.set(cfg)
}