Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpommerening committed Dec 10, 2015
1 parent f744d23 commit b0a7152
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"readable-stream": "~1.0.2"
},
"devDependencies": {
"nodeunit": "~0.7.4"
"nodeunit": "^0.9.1"
},
"keywords": [
"streams",
Expand Down
8 changes: 5 additions & 3 deletions test/readable_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ exports.readable = {
test.equal(instantiated, false, 'DummyReadable should only be instantiated when it is needed');

readable.on('readable', function() {
var chunk = readable.read();
actual.push(chunk.toString());
var chunk;
while ((chunk = readable.read())) {
actual.push(chunk.toString());
}
});
readable.on('end', function() {
test.equal(actual.join(''), expected.join(''), 'Readable should not change the data of the underlying stream');
Expand Down Expand Up @@ -82,7 +84,7 @@ exports.readable = {
});

test.equal(instantiated, false, 'DummyReadable should only be instantiated when it is needed');

readable.resume();
}
};

0 comments on commit b0a7152

Please sign in to comment.