diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2017-12-11 06:34:57 -0200 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2017-12-12 12:34:29 -0200 |
commit | 8d5b3de8cb3467ad9f29232f0ecbbd2fd6f99438 (patch) | |
tree | 221712417842b252c13d4cf2cf5d71d17f822f2e /test/common/index.js | |
parent | e17dba7a4553081a4ae84e4f27bf89e589e27fed (diff) | |
download | android-node-v8-8d5b3de8cb3467ad9f29232f0ecbbd2fd6f99438.tar.gz android-node-v8-8d5b3de8cb3467ad9f29232f0ecbbd2fd6f99438.tar.bz2 android-node-v8-8d5b3de8cb3467ad9f29232f0ecbbd2fd6f99438.zip |
test: simplify common.expectsError
The mustCall is actually only necessary in case it is used as
callback. Otherwise it works as a must call on its own.
PR-URL: https://github.com/nodejs/node/pull/17616
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Diffstat (limited to 'test/common/index.js')
-rw-r--r-- | test/common/index.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/common/index.js b/test/common/index.js index 81e76be0f3..6a22849843 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -735,7 +735,7 @@ exports.expectsError = function expectsError(fn, settings, exact) { settings = fn; fn = undefined; } - const innerFn = exports.mustCall(function(error) { + function innerFn(error) { assert.strictEqual(error.code, settings.code); if ('type' in settings) { const type = settings.type; @@ -768,12 +768,12 @@ exports.expectsError = function expectsError(fn, settings, exact) { }); } return true; - }, exact); + } if (fn) { assert.throws(fn, innerFn); return; } - return innerFn; + return exports.mustCall(innerFn, exact); }; exports.skipIfInspectorDisabled = function skipIfInspectorDisabled() { |