diff options
author | James M Snell <jasnell@gmail.com> | 2017-03-24 09:46:44 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-03-26 12:47:15 -0700 |
commit | 4f2e372716714ed030cb5ba6e67107b913f15343 (patch) | |
tree | 9b86be4f904c7844c48cca4194f3c3a5a1decad8 /test/parallel/test-stream-readable-event.js | |
parent | d13bd4acc0b60191f0d6e9fae92087242d04dfbd (diff) | |
download | android-node-v8-4f2e372716714ed030cb5ba6e67107b913f15343.tar.gz android-node-v8-4f2e372716714ed030cb5ba6e67107b913f15343.tar.bz2 android-node-v8-4f2e372716714ed030cb5ba6e67107b913f15343.zip |
test: add common.noop, default for common.mustCall()
Export a new common.noop no-operation function for general use.
Allow using common.mustCall() without a fn argument to simplify
test cases.
Replace various non-op functions throughout tests with common.noop
PR-URL: https://github.com/nodejs/node/pull/12027
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'test/parallel/test-stream-readable-event.js')
-rw-r--r-- | test/parallel/test-stream-readable-event.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-stream-readable-event.js b/test/parallel/test-stream-readable-event.js index aa56dcb89f..3e7a42ccee 100644 --- a/test/parallel/test-stream-readable-event.js +++ b/test/parallel/test-stream-readable-event.js @@ -40,7 +40,7 @@ const Readable = require('stream').Readable; setTimeout(function() { // we're testing what we think we are assert(!r._readableState.reading); - r.on('readable', common.mustCall(function() {})); + r.on('readable', common.mustCall()); }, 1); } @@ -52,7 +52,7 @@ const Readable = require('stream').Readable; highWaterMark: 3 }); - r._read = common.mustCall(function(n) {}); + r._read = common.mustCall(); // This triggers a 'readable' event, which is lost. r.push(Buffer.from('bl')); @@ -60,7 +60,7 @@ const Readable = require('stream').Readable; setTimeout(function() { // assert we're testing what we think we are assert(r._readableState.reading); - r.on('readable', common.mustCall(function() {})); + r.on('readable', common.mustCall()); }, 1); } @@ -80,6 +80,6 @@ const Readable = require('stream').Readable; setTimeout(function() { // assert we're testing what we think we are assert(!r._readableState.reading); - r.on('readable', common.mustCall(function() {})); + r.on('readable', common.mustCall()); }, 1); } |