2021-10-14 21:22:09 +00:00
|
|
|
var exec = require('execa').sync;
|
2018-01-08 10:02:44 +00:00
|
|
|
|
|
|
|
var failures = 0;
|
|
|
|
|
|
|
|
function runTest(variant, env) {
|
|
|
|
|
|
|
|
var NODE_ENV = process.env.NODE_ENV;
|
|
|
|
|
|
|
|
process.env.VARIANT = variant;
|
|
|
|
process.env.NODE_ENV = env;
|
|
|
|
|
2018-01-28 19:55:52 +00:00
|
|
|
console.log('[TEST] ' + variant + '@' + env);
|
2019-07-31 11:01:59 +00:00
|
|
|
console.log(`[EXEC] VARIANT=${variant} NODE_ENV=${env} karma start test/config/karma.distro.js`);
|
2018-01-08 10:02:44 +00:00
|
|
|
|
|
|
|
try {
|
2021-10-14 21:22:09 +00:00
|
|
|
exec('karma', [ 'start', 'test/config/karma.distro.js' ], {
|
|
|
|
stdio: 'inherit'
|
|
|
|
});
|
2018-01-08 10:02:44 +00:00
|
|
|
} catch (e) {
|
2018-03-21 11:00:36 +00:00
|
|
|
console.error('[TEST] FAILURE ' + variant + '@' + env);
|
2018-01-08 10:02:44 +00:00
|
|
|
console.error(e);
|
|
|
|
|
|
|
|
failures++;
|
|
|
|
} finally {
|
|
|
|
process.env.NODE_ENV = NODE_ENV;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
|
|
|
|
runTest('bpmn-modeler', 'development');
|
|
|
|
runTest('bpmn-modeler', 'production');
|
|
|
|
|
|
|
|
runTest('bpmn-navigated-viewer', 'development');
|
|
|
|
runTest('bpmn-navigated-viewer', 'production');
|
|
|
|
|
|
|
|
runTest('bpmn-viewer', 'development');
|
|
|
|
runTest('bpmn-viewer', 'production');
|
|
|
|
|
|
|
|
if (failures) {
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
test();
|