mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
0ae1684396
The second argument to "assert.throws" is usually a validation RegExp or function for the thrown error. However, the function also accepts a string and in this case it is interpreted as a message for the AssertionError and not used for validation. It is common for people to forget this and pass a validation string by mistake. This new rule checks that we never pass a string literal as a second argument to "assert.throws". Additionally, there is an option to enforce the function to be called with at least two arguments. It is currently off because we have many tests that do not comply with this rule. PR-URL: https://github.com/nodejs/node/pull/10089 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> |
||
---|---|---|
.. | ||
align-function-arguments.js | ||
align-multiline-assignment.js | ||
assert-fail-single-argument.js | ||
assert-throws-arguments.js | ||
buffer-constructor.js | ||
new-with-error.js | ||
no-let-in-for-declaration.js | ||
no-useless-regex-char-class-escape.js | ||
prefer-assert-methods.js | ||
require-buffer.js | ||
required-modules.js |