Comparing version 1.5.0 to 1.5.1
@@ -43,2 +43,6 @@ var pump = require('pump') | ||
ended = true | ||
// pump ends after the last stream is not writable *but* | ||
// pumpify still forwards the readable part so we need to catch errors | ||
// still, so reenable autoDestroy in this case | ||
if (self._autoDestroy === false) self._autoDestroy = true | ||
self.uncork() | ||
@@ -45,0 +49,0 @@ }) |
{ | ||
"name": "pumpify", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Combine an array of streams into a single duplex stream using pump and duplexify", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
31
test.js
@@ -5,2 +5,3 @@ var tape = require('tape') | ||
var stream = require('stream') | ||
var duplexify = require('duplexify') | ||
@@ -186,3 +187,3 @@ tape('basic', function(t) { | ||
var ws = new stream.Writable() | ||
var rs = new stream.Readable() | ||
var rs = new stream.Readable({highWaterMark: 16}) | ||
@@ -192,4 +193,7 @@ ws._write = function (data, enc, cb) { | ||
} | ||
rs._read = function () { | ||
this.push(Buffer.alloc(16 * 1024)) | ||
process.nextTick(function () { | ||
rs.push('hello world') | ||
}) | ||
} | ||
@@ -212,1 +216,24 @@ | ||
}) | ||
tape('returns error from duplexify', function (t) { | ||
var a = through() | ||
var b = duplexify() | ||
var s = pumpify() | ||
s.setPipeline(a, b) | ||
s.on('error', function (err) { | ||
t.same(err.message, 'stop') | ||
t.end() | ||
}) | ||
s.write('data') | ||
// Test passes if `.end()` is not called | ||
s.end() | ||
b.setWritable(through()) | ||
setImmediate(function () { | ||
b.destroy(new Error('stop')) | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10155
241