Comparing version 1.0.0 to 1.1.0
@@ -147,3 +147,3 @@ /* | ||
if (this._writable) | ||
this._callWrite(chunk, enc, cb) | ||
return this._callWrite(chunk, enc, cb) | ||
@@ -150,0 +150,0 @@ // we are in delayed open |
{ | ||
"name": "reduplexer", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Another Stream2 duplexer", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
37
test.js
@@ -66,2 +66,21 @@ | ||
test('finish event after end', function(t) { | ||
t.plan(2) | ||
var writable = new stream.PassThrough() | ||
, instance | ||
instance = duplexer(writable, writable) | ||
instance.on('data', function(chunk) { | ||
t.equal(chunk.toString(), 'a message') | ||
}) | ||
instance.on('finish', function() { | ||
t.ok(true, 'finish happened') | ||
}) | ||
instance.end('a message') | ||
}) | ||
test('objectMode', function(t) { | ||
@@ -238,2 +257,20 @@ t.plan(1) | ||
test('supports highWaterMark: 2', function(t) { | ||
var writable = new stream.Transform({ objectMode: true, highWaterMark: 2 }) | ||
, instance | ||
, unlock = null | ||
writable._transform = function(obj, enc, cb) { | ||
unlock = cb | ||
} | ||
instance = duplexer(writable, writable, { objectMode: true, highWaterMark: 2 }) | ||
t.ok(writable.write('hello'), 'after first we can write') | ||
t.notOk(writable.write('hello'), 'after second we cannot write more') | ||
t.end() | ||
}) | ||
if (process.browser) { | ||
@@ -240,0 +277,0 @@ return |
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
15547
377