1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-10 11:10:19 +02:00
video.js/test/karma.conf.js

81 lines
2.2 KiB
JavaScript
Raw Normal View History

const generate = require('videojs-generate-karma-config');
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;
// see https://github.com/videojs/videojs-generate-karma-config
// for options
const options = {
travisLaunchers(defaults) {
delete defaults.travisFirefox;
return defaults;
},
serverBrowsers(defaults) {
return [];
},
2019-08-30 20:14:53 +02:00
coverage: reportCoverage
};
config = generate(config, options);
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'
});
config.files = [
'dist/video-js.css',
'test/globals-shim.js',
'test/unit/**/*.js',
'test/dist/browserify.js',
'test/dist/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: [
2019-08-30 20:14:53 +02:00
['babelify', {presets: [['@babel/preset-env', {loose: true}]]}]
]
};
if (reportCoverage) {
config.browserify.transform.push('browserify-istanbul');
}
config.preprocessors = {
'test/globals-shim.js': ['browserify'],
2019-08-30 20:14:53 +02:00
'test/unit/**/*.js': ['browserify']
};
// pin Browserstack Firefox version to 64
2019-08-30 20:14:53 +02:00
/* eslint-disable camelcase */
config.customLaunchers.bsFirefox.browser_version = '64.0';
2019-08-30 20:14:53 +02:00
/* eslint-enable camelcase */
// 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 */
};