forked from kaltura/playkit-js-flash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
55 lines (51 loc) · 1.36 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
let webpackConfig = require('./webpack.config.js');
//Need to remove externals otherwise they won't be included in test
delete webpackConfig.externals;
// Need to define inline source maps when using karma
webpackConfig.devtool = 'inline-source-map';
const isWindows = /^win/.test(process.platform);
const isMacOS = /^darwin/.test(process.platform);
// Create custom launcher in case running with Travis
const customLaunchers = {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
};
module.exports = function(config) {
let karmaConf = {
logLevel: config.LOG_INFO,
browsers: ['Chrome', 'Firefox'],
concurrency: 1,
singleRun: true,
colors: true,
frameworks: ['mocha'],
files: ['test/setup/karma.js'],
preprocessors: {
'src/**/*.js': ['webpack', 'sourcemap'],
'test/setup/karma.js': ['webpack', 'sourcemap']
},
reporters: ['progress', 'coverage'],
webpack: webpackConfig,
webpackServer: {
noInfo: true
},
client: {
mocha: {
reporter: 'html',
timeout: 50000
}
}
};
if (process.env.TRAVIS) {
karmaConf.customLaunchers = customLaunchers;
karmaConf.browsers = ['Chrome_travis_ci'];
} else {
if (isWindows) {
karmaConf.browsers.push('IE');
} else if (isMacOS) {
karmaConf.browsers.push('Safari');
}
}
config.set(karmaConf);
};