Skip to content

Commit

Permalink
test: improve test-stream2-large-read-stall
Browse files Browse the repository at this point in the history
* use const instead of var
* use assert.strictEqual instead of assert.equal
* use  common.mustCall instead of process.on( 'exit', fn )

PR-URL: #10725
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Italo A. Casas <[email protected]>
  • Loading branch information
stefanjudis authored and MylesBorins committed Mar 9, 2017
1 parent 9ac2316 commit ee27917
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/parallel/test-stream2-large-read-stall.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ r.on('readable', function() {
rs.length);
});

r.on('end', common.mustCall(function() {}));
r.on('end', common.mustCall(function() {
assert.strictEqual(pushes, PUSHCOUNT + 1);
}));

var pushes = 0;
function push() {
Expand All @@ -48,7 +50,3 @@ function push() {
if (r.push(new Buffer(PUSHSIZE)))
setTimeout(push);
}

process.on('exit', function() {
assert.equal(pushes, PUSHCOUNT + 1);
});

0 comments on commit ee27917

Please sign in to comment.