2018-10-31 17:01:30 +02:00
|
|
|
const generate = require('videojs-generate-karma-config');
|
2014-05-17 00:48:05 +03:00
|
|
|
|
2018-10-31 17:01:30 +02:00
|
|
|
module.exports = function(config) {
|
|
|
|
const coverageFlag = process.env.npm_config_coverage;
|
|
|
|
const reportCoverage = false; // process.env.TRAVIS || coverageFlag || false;
|
2015-03-27 22:52:40 +02:00
|
|
|
|
2018-10-31 17:01:30 +02:00
|
|
|
// see https://github.com/videojs/videojs-generate-karma-config
|
|
|
|
// for options
|
|
|
|
const options = {
|
|
|
|
serverBrowsers(defaults) {
|
|
|
|
return [];
|
2017-02-28 22:02:18 +02:00
|
|
|
},
|
2018-10-31 17:01:30 +02:00
|
|
|
coverage: reportCoverage,
|
|
|
|
};
|
2017-02-28 22:02:18 +02:00
|
|
|
|
2018-10-31 17:01:30 +02:00
|
|
|
config = generate(config, options);
|
|
|
|
|
|
|
|
config.files = [
|
|
|
|
'dist/video-js.css',
|
|
|
|
'test/globals-shim.js',
|
|
|
|
'test/unit/**/*.js',
|
|
|
|
'build/temp/browserify.js',
|
|
|
|
'build/temp/webpack.js',
|
|
|
|
{pattern: 'src/**/*.js', watched: true, included: false, served: false }
|
|
|
|
];
|
|
|
|
|
|
|
|
config.browserStack.project = 'Video.js';
|
|
|
|
|
|
|
|
config.frameworks.push('browserify');
|
|
|
|
config.browserify = {
|
|
|
|
debug: true,
|
|
|
|
plugin: ['proxyquireify/plugin'],
|
|
|
|
transform: [
|
|
|
|
['babelify', {"presets": [["@babel/preset-env", {"loose": true}]]}],
|
|
|
|
]
|
2015-06-10 03:57:20 +02:00
|
|
|
};
|
|
|
|
|
2016-08-18 00:32:48 +02:00
|
|
|
if (reportCoverage) {
|
2018-10-31 17:01:30 +02:00
|
|
|
config.browserify.transform.push('browserify-istanbul');
|
2015-06-10 03:57:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-10-31 17:01:30 +02:00
|
|
|
config.preprocessors = {
|
|
|
|
'test/**/*.js': ['browserify']
|
2015-06-10 03:57:20 +02:00
|
|
|
};
|
2018-10-31 17:01:30 +02:00
|
|
|
|
|
|
|
};
|