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) {
|
2019-08-30 20:14:53 +02:00
|
|
|
// const coverageFlag = process.env.npm_config_coverage;
|
|
|
|
// process.env.TRAVIS || coverageFlag || false;
|
|
|
|
const reportCoverage = 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 = {
|
2018-11-29 00:26:00 +02:00
|
|
|
travisLaunchers(defaults) {
|
|
|
|
delete defaults.travisFirefox;
|
|
|
|
return defaults;
|
|
|
|
},
|
2018-10-31 17:01:30 +02:00
|
|
|
serverBrowsers(defaults) {
|
|
|
|
return [];
|
2017-02-28 22:02:18 +02:00
|
|
|
},
|
2019-08-30 20:14:53 +02:00
|
|
|
coverage: reportCoverage
|
2018-10-31 17:01:30 +02:00
|
|
|
};
|
2017-02-28 22:02:18 +02:00
|
|
|
|
2018-10-31 17:01:30 +02:00
|
|
|
config = generate(config, options);
|
|
|
|
|
2018-11-29 00:26:00 +02:00
|
|
|
config.proxies = config.proxies || {};
|
|
|
|
|
|
|
|
// disable warning logs for sourceset tests, by proxing to a remote host
|
|
|
|
Object.assign(config.proxies, {
|
|
|
|
'/test/relative-one.mp4': 'http://example.com/relative-one.mp4',
|
|
|
|
'/test/relative-two.mp4': 'http://example.com/relative-two.mp4',
|
|
|
|
'/test/relative-three.mp4': 'http://example.com/relative-three.mp4'
|
|
|
|
});
|
|
|
|
|
2018-10-31 17:01:30 +02:00
|
|
|
config.files = [
|
|
|
|
'dist/video-js.css',
|
|
|
|
'test/globals-shim.js',
|
|
|
|
'test/unit/**/*.js',
|
2018-11-30 23:37:29 +02:00
|
|
|
'test/dist/browserify.js',
|
|
|
|
'test/dist/webpack.js',
|
2018-10-31 17:01:30 +02:00
|
|
|
{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: [
|
2019-08-30 20:14:53 +02:00
|
|
|
['babelify', {presets: [['@babel/preset-env', {loose: true}]]}]
|
2018-10-31 17:01:30 +02:00
|
|
|
]
|
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 = {
|
2018-11-30 23:37:29 +02:00
|
|
|
'test/globals-shim.js': ['browserify'],
|
2019-08-30 20:14:53 +02:00
|
|
|
'test/unit/**/*.js': ['browserify']
|
2015-06-10 03:57:20 +02:00
|
|
|
};
|
2018-10-31 17:01:30 +02:00
|
|
|
|
2019-02-12 17:10:37 +02:00
|
|
|
// pin Browserstack Firefox version to 64
|
2019-08-30 20:14:53 +02:00
|
|
|
/* eslint-disable camelcase */
|
2019-02-12 17:10:37 +02:00
|
|
|
config.customLaunchers.bsFirefox.browser_version = '64.0';
|
2019-08-30 20:14:53 +02:00
|
|
|
/* eslint-enable camelcase */
|
2019-02-12 17:10:37 +02:00
|
|
|
|
|
|
|
// uncomment the section below to re-enable all browserstack video recording
|
|
|
|
// it is off by default because it slows the build
|
|
|
|
/*
|
|
|
|
Object.keys(config.customLaunchers).forEach(function(cl) {
|
|
|
|
if ('browserstack.video' in config.customLaunchers[cl]) {
|
|
|
|
config.customLaunchers[cl]['browserstack.video'] = "true";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
*/
|
2019-08-30 20:14:53 +02:00
|
|
|
|
|
|
|
/* eslint-disable no-console */
|
|
|
|
console.log(JSON.stringify(config, null, 2));
|
|
|
|
/* eslint-enable no-console */
|
|
|
|
|
2018-10-31 17:01:30 +02:00
|
|
|
};
|