Browse Source

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: https://github.com/nodejs/node/pull/10725
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
v6.x
stefan judis 8 years ago
committed by Myles Borins
parent
commit
b01db3a73f
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 8
      test/parallel/test-stream2-large-read-stall.js

8
test/parallel/test-stream2-large-read-stall.js

@ -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() {
@ -48,7 +50,3 @@ function push() {
if (r.push(Buffer.allocUnsafe(PUSHSIZE)))
setTimeout(push, 1);
}
process.on('exit', function() {
assert.equal(pushes, PUSHCOUNT + 1);
});

Loading…
Cancel
Save