Comparing version
@@ -61,4 +61,6 @@ // Copyright 2014. A Medium Corporation | ||
this.mapper(chunk, function (err, data) { | ||
if (err) return callback(err) | ||
this.push(data) | ||
callback(err) | ||
callback(null) | ||
}.bind(this)) | ||
@@ -65,0 +67,0 @@ } |
{ | ||
"name": "sculpt", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Generate Node 0.10-friendly transform streams to manipulate other streams.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -103,2 +103,19 @@ // Copyright 2014. A Medium Corporation | ||
}) | ||
it('Should not throw on pushing data when async streams have an error', function (done) { | ||
var stream = map(function (data, callback) { | ||
callback(new Error('This stream never works')) | ||
}).async().multi() | ||
stream.on('error', function (err) { | ||
assert.ok(err) | ||
done() | ||
}) | ||
stream.on('end', function () { | ||
done(new Error('This stream should error before it ends')) | ||
}) | ||
stream.end('I see a Mansard roof through the trees') | ||
}) | ||
}) |
101410
137.54%38
15.15%905
5.23%3
50%