From e9f5b7ca7591e6ca3929401450786318f612d4f9 Mon Sep 17 00:00:00 2001 From: stefan judis Date: Tue, 10 Jan 2017 17:38:48 +0100 Subject: [PATCH] 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 Reviewed-By: Italo A. Casas --- test/parallel/test-stream2-large-read-stall.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-stream2-large-read-stall.js b/test/parallel/test-stream2-large-read-stall.js index 36d4e0c6c9d7c9..2422747f820bc1 100644 --- a/test/parallel/test-stream2-large-read-stall.js +++ b/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); -});