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 <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
  • Loading branch information
stefanjudis authored and jasnell committed Mar 8, 2017
1 parent 9f5a905 commit 3c5f65f
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(Buffer.allocUnsafe(PUSHSIZE)))
setTimeout(push, 1);
}

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

0 comments on commit 3c5f65f

Please sign in to comment.