Skip to content

Commit 9a27a20

Browse files
committed
Test that no error events are emitted on successful tests
That the stream produced data and ended does not necessarily mean that no error occured.
1 parent 3694e01 commit 9a27a20

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/simple.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test('accepts data in both write and end', function(t) {
77
t.plan(1);
88
var compressed = fs.readFileSync('test/fixtures/text.bz2');
99
var unbz2 = unbzip2Stream();
10+
unbz2.on('error', function(err) { t.fail(err.message); });
1011
unbz2.pipe( concat(function(data) {
1112
var expected = "Hello World!\nHow little you are. now.\n\n";
1213
t.equal(data.toString('utf-8'), expected);
@@ -19,6 +20,7 @@ test('accepts concatenated bz2 streams', function(t) {
1920
t.plan(1);
2021
var compressed = fs.readFileSync('test/fixtures/concatenated.bz2');
2122
var unbz2 = unbzip2Stream();
23+
unbz2.on('error', function(err) { t.fail(err.message); });
2224
unbz2.pipe( concat(function(data) {
2325
var expected = "ab\n";
2426
t.equal(data.toString('utf-8'), expected);

0 commit comments

Comments
 (0)