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 italoacasas committed Jan 30, 2017
1 parent 7f04377 commit 46bbabe
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 @@ -33,7 +33,9 @@ r.on('readable', function() {
rs.length);
});

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

let pushes = 0;
function push() {
Expand All @@ -49,7 +51,3 @@ function push() {
if (r.push(Buffer.allocUnsafe(PUSHSIZE)))
setTimeout(push, 1);
}

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

0 comments on commit 46bbabe

Please sign in to comment.