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: nodejs#10725
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
  • Loading branch information
stefanjudis authored and italoacasas committed Jan 18, 2017
1 parent 8c9cf4f commit e9f5b7c
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 e9f5b7c

Please sign in to comment.