@exabyte-io/chimpy
Version:
Develop acceptance tests & end-to-end tests with realtime feedback.
24 lines (19 loc) • 574 B
JavaScript
require('shelljs/global');
var exec = require('./lib/exec');
var nodeIndex = parseInt(env.CIRCLE_NODE_INDEX, 10);
var isCI = !isNaN(nodeIndex);
var run = function (runOnNodeIndex, name, command) {
if (!isCI || nodeIndex === runOnNodeIndex) {
echo(name);
if (exec(command).code !== 0) {
exit(1);
}
}
};
var unitTestsCommand = './node_modules/.bin/jest';
if (isCI) {
// Prevent exceeding the maximum RAM. Each worker needs ~385MB.
unitTestsCommand += ' --maxWorkers 4';
}
run(0, 'Running Chimp Unit tests', unitTestsCommand);