karma.conf.js
1.23 KB
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
const generate = require('videojs-generate-karma-config');
const CI_TEST_TYPE = process.env.CI_TEST_TYPE || '';
module.exports = function(config) {
// see https://github.com/videojs/videojs-generate-karma-config
// for options
const options = {
coverage: CI_TEST_TYPE === 'coverage' ? true : false,
preferHeadless: false,
browsers(aboutToRun) {
return aboutToRun.filter(function(launcherName) {
return !(/^(Safari|Chromium)/).test(launcherName);
});
},
files(defaults) {
defaults.unshift('node_modules/es5-shim/es5-shim.js');
defaults.unshift('node_modules/es6-shim/es6-shim.js');
defaults.splice(
defaults.indexOf('node_modules/video.js/dist/video.js'),
1,
'node_modules/video.js/dist/alt/video.core.js'
);
return defaults;
},
browserstackLaunchers(defaults) {
delete defaults.bsSafariMojave;
delete defaults.bsSafariElCapitan;
// do not run on browserstack for coverage
if (CI_TEST_TYPE === 'coverage') {
defaults = {};
}
return defaults;
},
serverBrowsers() {
return [];
}
};
config = generate(config, options);
// any other custom stuff not supported by options here!
};