Browse Source

test: Sync writables may emit finish before callbacks

v0.9.4-release
isaacs 12 years ago
parent
commit
f8bb031bdc
  1. 6
      test/simple/test-stream2-writable.js

6
test/simple/test-stream2-writable.js

@ -59,6 +59,10 @@ function run() {
var name = next[0];
var fn = next[1];
if (!fn)
return run();
console.log('# %s', name);
fn({
same: assert.deepEqual,
@ -228,10 +232,12 @@ test('write callbacks', function (t) {
});
tw.on('finish', function() {
process.nextTick(function() {
t.same(tw.buffer, chunks, 'got chunks in the right order');
t.same(callbacks._called, chunks, 'called all callbacks');
t.end();
});
});
chunks.forEach(function(chunk, i) {
tw.write(chunk, callbacks['callback-' + i]);

Loading…
Cancel
Save