bpmn-js/test/config/karma.unit.js

93 lines
1.7 KiB
JavaScript
Raw Normal View History

var path = require('path');
var basePath = '../../';
var absoluteBasePath = path.resolve(path.join(__dirname, basePath));
/* 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';
}
}
return browser;
});
2014-03-11 14:54:36 +00:00
module.exports = function(karma) {
karma.set({
basePath: basePath,
2014-03-11 14:54:36 +00:00
2015-10-09 23:35:41 +00:00
frameworks: [
'mocha',
'sinon-chai'
],
2014-03-11 14:54:36 +00:00
files: [
'test/suite.js'
2014-03-11 14:54:36 +00:00
],
2014-03-11 14:54:36 +00:00
preprocessors: {
'test/suite.js': [ 'webpack', '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
customLaunchers: {
ChromeHeadless_Linux: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
'--disable-setuid-sandbox'
],
debug: true
}
},
browsers: browsers,
2014-03-11 14:54:36 +00:00
browserNoActivityTimeout: 30000,
2014-07-17 07:02:40 +00:00
singleRun: true,
autoWatch: false,
2014-03-11 14:54:36 +00:00
webpack: {
mode: 'development',
module: {
rules: [
{
test: /\.css|\.bpmn$/,
use: 'raw-loader'
}
]
},
resolve: {
mainFields: [
'dev:module',
'browser',
'module',
'main'
],
modules: [
'node_modules',
absoluteBasePath
]
}
2014-03-11 14:54:36 +00:00
}
});
};