Permalink
Browse files

test: improve test-stream2-large-read-stall

* 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 italoacasas committed Jan 10, 2017
1 parent c963094 commit c685638986347557b70f9a1d3437508282012ba3
Showing with 3 additions and 5 deletions.
  1. +3 −5 test/parallel/test-stream2-large-read-stall.js
@@ -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() {
@@ -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 c685638

Please sign in to comment.