summaryrefslogtreecommitdiff
path: root/deps/npm
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2016-11-26 11:31:10 +0100
committerMichaël Zasso <targos@protonmail.com>2016-12-05 16:01:12 +0100
commit0ae1684396d87bffe6bf3a4c77c30bb725bfc5d4 (patch)
tree17828b078cc38fa1990a73c69743468df20c0a0b /deps/npm
parent9366b8d90a479777c362774fb53ab15b16d07bad (diff)
downloadandroid-node-v8-0ae1684396d87bffe6bf3a4c77c30bb725bfc5d4.tar.gz
android-node-v8-0ae1684396d87bffe6bf3a4c77c30bb725bfc5d4.tar.bz2
android-node-v8-0ae1684396d87bffe6bf3a4c77c30bb725bfc5d4.zip
tools: add ESLint rule for assert.throws arguments
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>
Diffstat (limited to 'deps/npm')
0 files changed, 0 insertions, 0 deletions