2015-03-31 12:17:15 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-10-05 13:08:49 +00:00
|
|
|
var path = require('path');
|
|
|
|
|
|
|
|
var basePath = '../../';
|
|
|
|
|
|
|
|
var absoluteBasePath = path.resolve(path.join(__dirname, basePath));
|
|
|
|
|
2017-10-22 20:21:51 +00:00
|
|
|
/* 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;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-10-05 13:08:49 +00:00
|
|
|
|
2014-03-11 14:54:36 +00:00
|
|
|
module.exports = function(karma) {
|
|
|
|
karma.set({
|
|
|
|
|
2015-10-05 13:08:49 +00:00
|
|
|
basePath: basePath,
|
2014-03-11 14:54:36 +00:00
|
|
|
|
2015-10-09 23:35:41 +00:00
|
|
|
frameworks: [
|
|
|
|
'browserify',
|
|
|
|
'mocha',
|
|
|
|
'sinon-chai'
|
|
|
|
],
|
2014-03-11 14:54:36 +00:00
|
|
|
|
|
|
|
files: [
|
2015-10-09 23:35:41 +00:00
|
|
|
'test/**/*Spec.js'
|
2014-03-11 14:54:36 +00:00
|
|
|
],
|
2014-04-29 23:57:54 +00:00
|
|
|
|
2014-03-11 14:54:36 +00:00
|
|
|
preprocessors: {
|
2016-05-03 14:23:31 +00:00
|
|
|
'test/**/*Spec.js': [ 'browserify', 'env' ]
|
2014-03-11 14:54:36 +00:00
|
|
|
},
|
|
|
|
|
2016-06-07 08:25:00 +00:00
|
|
|
reporters: [ 'spec' ],
|
2015-10-09 23:35:41 +00:00
|
|
|
|
2017-10-22 20:21:51 +00:00
|
|
|
browsers: browsers,
|
2014-03-11 14:54:36 +00:00
|
|
|
|
2014-09-25 07:54:40 +00:00
|
|
|
browserNoActivityTimeout: 30000,
|
2014-07-17 07:02:40 +00:00
|
|
|
|
2014-03-11 14:54:36 +00:00
|
|
|
singleRun: false,
|
|
|
|
autoWatch: true,
|
|
|
|
|
|
|
|
// browserify configuration
|
|
|
|
browserify: {
|
|
|
|
debug: true,
|
2015-10-05 13:08:49 +00:00
|
|
|
paths: [ absoluteBasePath ],
|
2015-03-31 12:17:15 +00:00
|
|
|
transform: [ [ 'stringify', { global: true, extensions: [ '.bpmn', '.xml', '.css' ] } ] ]
|
2014-03-11 14:54:36 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|