flush-write-stream
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -50,4 +50,4 @@ var stream = require('readable-stream') | ||
this.destroyed = true | ||
if (err) this.emit('error') | ||
if (err) this.emit('error', err) | ||
this.emit('close') | ||
} |
{ | ||
"name": "flush-write-stream", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A write stream constructor that supports a flush function that is called before finish is emitted", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
13
test.js
@@ -73,1 +73,14 @@ var tape = require('tape') | ||
}) | ||
tape('emits error on destroy', function (t) { | ||
var expected = new Error() | ||
var ws = writer({objectMode: true}, function () {}) | ||
ws.on('error', function (err) { | ||
t.equal(err, expected) | ||
}) | ||
ws.on('close', t.end) | ||
ws.destroy(expected) | ||
}) |
6423
8
126