From ec357bf88f59321a8938ded7857b74d231912a84 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 26 May 2017 14:54:51 -0700 Subject: [PATCH] test: use mustNotCall() in test-stream2-objects Use `common.mustNotCall()` in test-stream2-objects.js to confirm that noop function is never invoked. PR-URL: https://github.com/nodejs/node/pull/13249 Reviewed-By: Refael Ackermann Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/parallel/test-stream2-objects.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-stream2-objects.js b/test/parallel/test-stream2-objects.js index 159286a4322257..6894d4b9171411 100644 --- a/test/parallel/test-stream2-objects.js +++ b/test/parallel/test-stream2-objects.js @@ -76,7 +76,7 @@ function toArray(callback) { function fromArray(list) { const r = new Readable({ objectMode: true }); - r._read = common.noop; + r._read = common.mustNotCall(); list.forEach(function(chunk) { r.push(chunk); }); @@ -164,7 +164,7 @@ test('can read strings as objects', function(t) { const r = new Readable({ objectMode: true }); - r._read = common.noop; + r._read = common.mustNotCall(); const list = ['one', 'two', 'three']; list.forEach(function(str) { r.push(str); @@ -182,7 +182,7 @@ test('read(0) for object streams', function(t) { const r = new Readable({ objectMode: true }); - r._read = common.noop; + r._read = common.mustNotCall(); r.push('foobar'); r.push(null); @@ -198,7 +198,7 @@ test('falsey values', function(t) { const r = new Readable({ objectMode: true }); - r._read = common.noop; + r._read = common.mustNotCall(); r.push(false); r.push(0); @@ -249,7 +249,7 @@ test('high watermark push', function(t) { highWaterMark: 6, objectMode: true }); - r._read = common.noop; + r._read = common.mustNotCall(); for (let i = 0; i < 6; i++) { const bool = r.push(i); assert.strictEqual(bool, i !== 5);