chore(snapshot): don't call gulp callback more than once on error

This commit is contained in:
Tim Lancina
2016-02-05 10:25:50 -06:00
parent 5439ebbcc7
commit f25f316dff

View File

@ -64,13 +64,18 @@ module.exports = function(gulp, argv, buildConfig) {
} }
function protractor(done, args) { function protractor(done, args) {
var errored = false;
var child = cp.spawn('protractor', args, { var child = cp.spawn('protractor', args, {
stdio: [process.stdin, process.stdout, 'pipe'] stdio: [process.stdin, process.stdout, 'pipe']
}); });
child.stderr.on('data', function(data) { child.stderr.on('data', function(data) {
protractorHttpServer.close(); protractorHttpServer.close();
done('Protractor tests failed. Error:', data.toString()); console.error(data.toString());
if (!errored) {
errored = true;
done('Protractor tests failed.');
}
}); });
child.on('exit', function() { child.on('exit', function() {