Comparing version 0.0.3 to 0.0.4
@@ -48,3 +48,3 @@ /* | ||
assert(!this._readable, 'already hooked to a Writable') | ||
assert(!this._writable, 'already hooked to a Writable') | ||
assert(writable) | ||
@@ -51,0 +51,0 @@ this._writable = writable |
{ | ||
"name": "reduplexer", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Another Stream2 duplexer", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
32
test.js
@@ -125,2 +125,34 @@ | ||
test('late hook reversed', function(t) { | ||
t.plan(2) | ||
var writable = new stream.Writable() | ||
, readable = new stream.Readable() | ||
// nothing here, let's hook them up later | ||
, instance = duplexer() | ||
writable._write = function(chunk, enc, cb) { | ||
t.equal(chunk.toString(), 'writable') | ||
cb() | ||
} | ||
readable._read = function(n) { | ||
this.push('readable') | ||
this.push(null) | ||
} | ||
instance.on('data', function(chunk) { | ||
t.equal(chunk.toString(), 'readable') | ||
}) | ||
instance.end('writable') | ||
// separate hooks for redable | ||
instance.hookReadable(readable) | ||
// and writable | ||
instance.hookWritable(writable) | ||
}) | ||
test('shortcut hook', function(t) { | ||
@@ -127,0 +159,0 @@ t.plan(2) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
224433
264