Skip to content

Commit f25f316

Browse files
committed
chore(snapshot): don't call gulp callback more than once on error
1 parent 5439ebb commit f25f316

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/snapshot/snapshot.task.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,18 @@ module.exports = function(gulp, argv, buildConfig) {
6464
}
6565

6666
function protractor(done, args) {
67+
var errored = false;
6768
var child = cp.spawn('protractor', args, {
6869
stdio: [process.stdin, process.stdout, 'pipe']
6970
});
7071

7172
child.stderr.on('data', function(data) {
7273
protractorHttpServer.close();
73-
done('Protractor tests failed. Error:', data.toString());
74+
console.error(data.toString());
75+
if (!errored) {
76+
errored = true;
77+
done('Protractor tests failed.');
78+
}
7479
});
7580

7681
child.on('exit', function() {

0 commit comments

Comments
 (0)