2018-01-08 10:02:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/* global process */
|
|
|
|
|
|
|
|
// configures browsers to run test against
|
|
|
|
// any of [ 'ChromeHeadless', 'Chrome', 'Firefox', 'IE', 'PhantomJS' ]
|
|
|
|
var browsers =
|
|
|
|
(process.env.TEST_BROWSERS || 'PhantomJS')
|
|
|
|
.replace(/^\s+|\s+$/, '')
|
|
|
|
.split(/\s*,\s*/g)
|
|
|
|
.map(function(browser) {
|
|
|
|
if (browser === 'ChromeHeadless') {
|
|
|
|
process.env.CHROME_BIN = require('puppeteer').executablePath();
|
|
|
|
|
|
|
|
// workaround https://github.com/GoogleChrome/puppeteer/issues/290
|
|
|
|
if (process.platform === 'linux') {
|
|
|
|
return 'ChromeHeadless_Linux';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return browser;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var VARIANT = process.env.VARIANT;
|
|
|
|
|
|
|
|
var NODE_ENV = process.env.NODE_ENV;
|
|
|
|
|
|
|
|
module.exports = function(karma) {
|
|
|
|
karma.set({
|
|
|
|
|
|
|
|
basePath: '../../',
|
|
|
|
|
|
|
|
frameworks: [
|
|
|
|
'mocha',
|
|
|
|
'sinon-chai'
|
|
|
|
],
|
|
|
|
|
|
|
|
files: [
|
2018-01-28 19:55:52 +00:00
|
|
|
'dist/' + VARIANT + '.' + (NODE_ENV === 'production' ? 'production.min' : 'development') + '.js',
|
2018-01-08 10:02:44 +00:00
|
|
|
'dist/assets/bpmn-font/css/bpmn.css',
|
|
|
|
'dist/assets/diagram-js.css',
|
|
|
|
{ pattern: 'resources/initial.bpmn', included: false },
|
|
|
|
{ pattern: 'dist/assets/**/*', included: false },
|
|
|
|
'test/distro/helper.js',
|
2018-01-28 19:55:52 +00:00
|
|
|
'test/distro/' + VARIANT + '.js'
|
2018-01-08 10:02:44 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
reporters: [ 'spec' ],
|
|
|
|
|
|
|
|
customLaunchers: {
|
|
|
|
ChromeHeadless_Linux: {
|
|
|
|
base: 'ChromeHeadless',
|
|
|
|
flags: [
|
|
|
|
'--no-sandbox',
|
|
|
|
'--disable-setuid-sandbox'
|
|
|
|
],
|
|
|
|
debug: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
browsers: browsers,
|
|
|
|
|
|
|
|
browserNoActivityTimeout: 30000,
|
|
|
|
|
|
|
|
singleRun: true,
|
|
|
|
autoWatch: false
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|