diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-01-15 23:37:09 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-01-16 19:57:36 +0100 |
commit | d07c6f9739360954e8e6c6f16bf061a7f64bda9c (patch) | |
tree | c842de376eb55a95a24a990d09bb7d010f13a1ff /test | |
parent | f76ef504326f8a37cdb0d3dae705239d685abffc (diff) | |
download | android-node-v8-d07c6f9739360954e8e6c6f16bf061a7f64bda9c.tar.gz android-node-v8-d07c6f9739360954e8e6c6f16bf061a7f64bda9c.tar.bz2 android-node-v8-d07c6f9739360954e8e6c6f16bf061a7f64bda9c.zip |
assert: throw without args in ok
`assert.ok()` should always receive a value. Otherwise there
might be a bug or it was intended to use `assert.fail()`.
PR-URL: https://github.com/nodejs/node/pull/17581
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ron Korving <ron@ronkorving.nl>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-assert.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index c1b32c1e5c..ccfe276c80 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -754,6 +754,20 @@ common.expectsError( assert.equal(Object.keys(assert).length, Object.keys(a).length); /* eslint-enable no-restricted-properties */ assert(7); + common.expectsError( + () => assert(), + { + code: 'ERR_MISSING_ARGS', + type: TypeError + } + ); + common.expectsError( + () => a(), + { + code: 'ERR_MISSING_ARGS', + type: TypeError + } + ); // Test setting the limit to zero and that assert.strict works properly. const tmpLimit = Error.stackTraceLimit; |