2020-03-12 11:29:03 +01:00
|
|
|
/* global process */
|
2018-10-01 10:45:18 +02:00
|
|
|
|
2015-10-05 15:08:49 +02:00
|
|
|
var path = require('path');
|
|
|
|
|
2020-03-12 11:29:03 +01:00
|
|
|
var coverage = process.env.COVERAGE;
|
2017-10-22 22:21:51 +02:00
|
|
|
|
|
|
|
// configures browsers to run test against
|
|
|
|
// any of [ 'ChromeHeadless', 'Chrome', 'Firefox', 'IE', 'PhantomJS' ]
|
2020-03-12 11:29:03 +01:00
|
|
|
var browsers = (process.env.TEST_BROWSERS || 'PhantomJS').split(',');
|
|
|
|
|
|
|
|
// use puppeteer provided Chrome for testing
|
|
|
|
process.env.CHROME_BIN = require('puppeteer').executablePath();
|
|
|
|
|
|
|
|
var basePath = '../..';
|
|
|
|
|
|
|
|
var absoluteBasePath = path.resolve(path.join(__dirname, basePath));
|
2017-10-22 22:21:51 +02:00
|
|
|
|
2019-12-10 15:57:52 +01:00
|
|
|
var suite = coverage ? 'test/coverageBundle.js' : 'test/testBundle.js';
|
2018-10-01 10:45:18 +02:00
|
|
|
|
2015-10-05 15:08:49 +02:00
|
|
|
|
2014-03-11 15:54:36 +01:00
|
|
|
module.exports = function(karma) {
|
|
|
|
karma.set({
|
|
|
|
|
2020-03-12 11:29:03 +01:00
|
|
|
basePath,
|
2014-03-11 15:54:36 +01:00
|
|
|
|
2015-10-10 01:35:41 +02:00
|
|
|
frameworks: [
|
|
|
|
'mocha',
|
|
|
|
'sinon-chai'
|
|
|
|
],
|
2014-03-11 15:54:36 +01:00
|
|
|
|
|
|
|
files: [
|
2018-10-01 10:45:18 +02:00
|
|
|
suite
|
2014-03-11 15:54:36 +01:00
|
|
|
],
|
2014-04-30 01:57:54 +02:00
|
|
|
|
2014-03-11 15:54:36 +01:00
|
|
|
preprocessors: {
|
2018-10-01 10:45:18 +02:00
|
|
|
[ suite ]: [ 'webpack', 'env' ]
|
2014-03-11 15:54:36 +01:00
|
|
|
},
|
|
|
|
|
2019-01-08 22:40:41 +01:00
|
|
|
reporters: [ 'progress' ].concat(coverage ? 'coverage' : []),
|
2015-10-10 01:35:41 +02:00
|
|
|
|
2018-10-01 10:45:18 +02:00
|
|
|
coverageReporter: {
|
|
|
|
reporters: [
|
|
|
|
{ type: 'lcov', subdir: '.' }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2020-03-12 11:29:03 +01:00
|
|
|
browsers,
|
2014-03-11 15:54:36 +01:00
|
|
|
|
2014-09-25 09:54:40 +02:00
|
|
|
browserNoActivityTimeout: 30000,
|
2014-07-17 09:02:40 +02:00
|
|
|
|
2018-01-05 16:09:39 +01:00
|
|
|
singleRun: true,
|
|
|
|
autoWatch: false,
|
2014-03-11 15:54:36 +01:00
|
|
|
|
2018-07-13 15:50:55 +02:00
|
|
|
webpack: {
|
|
|
|
mode: 'development',
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.css|\.bpmn$/,
|
|
|
|
use: 'raw-loader'
|
|
|
|
}
|
2018-10-01 10:45:18 +02:00
|
|
|
].concat(coverage ?
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
use: {
|
|
|
|
loader: 'istanbul-instrumenter-loader',
|
|
|
|
options: { esModules: true }
|
|
|
|
},
|
|
|
|
include: /lib\.*/,
|
|
|
|
exclude: /node_modules/
|
|
|
|
} : []
|
|
|
|
)
|
2018-07-13 15:50:55 +02:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
mainFields: [
|
|
|
|
'dev:module',
|
|
|
|
'browser',
|
|
|
|
'module',
|
|
|
|
'main'
|
|
|
|
],
|
|
|
|
modules: [
|
|
|
|
'node_modules',
|
|
|
|
absoluteBasePath
|
|
|
|
]
|
2019-11-06 11:22:35 +01:00
|
|
|
},
|
|
|
|
devtool: 'eval-source-map'
|
2014-03-11 15:54:36 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|