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/addons | |
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/addons')
-rw-r--r-- | test/addons/async-hello-world/test.js | 2 | ||||
-rw-r--r-- | test/addons/heap-profiler/test.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/addons/async-hello-world/test.js b/test/addons/async-hello-world/test.js index a6aa8aa20f..fbd0d7eeb7 100644 --- a/test/addons/async-hello-world/test.js +++ b/test/addons/async-hello-world/test.js @@ -6,5 +6,5 @@ const binding = require(`./build/${common.buildType}/binding`); binding(5, common.mustCall(function(err, val) { assert.strictEqual(err, null); assert.strictEqual(val, 10); - process.nextTick(common.mustCall(function() {})); + process.nextTick(common.mustCall()); })); diff --git a/test/addons/heap-profiler/test.js b/test/addons/heap-profiler/test.js index 32b32ddb6e..c9974a060a 100644 --- a/test/addons/heap-profiler/test.js +++ b/test/addons/heap-profiler/test.js @@ -5,7 +5,7 @@ const common = require('../../common'); const binding = require(`./build/${common.buildType}/binding`); // Create an AsyncWrap object. -const timer = setTimeout(function() {}, 1); +const timer = setTimeout(common.noop, 1); timer.unref(); // Stress-test the heap profiler. |