From 15bb8437fd0a0eb07845ccf746c9ecb47fcfcb25 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 12 Feb 2018 12:25:04 +0100 Subject: tools: add assert.doesNotThrow eslint rule Prohibit the usage of `assert.doesNotThrow()`. PR-URL: https://github.com/nodejs/node/pull/18669 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Matteo Collina --- doc/api/assert.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/api/assert.md') diff --git a/doc/api/assert.md b/doc/api/assert.md index ca414e1c7c..cedbc14d42 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -341,6 +341,7 @@ to the caller. The following, for instance, will throw the [`TypeError`][] because there is no matching error type in the assertion: + ```js assert.doesNotThrow( () => { @@ -353,6 +354,7 @@ assert.doesNotThrow( However, the following will result in an `AssertionError` with the message 'Got unwanted exception (TypeError)..': + ```js assert.doesNotThrow( () => { @@ -366,6 +368,7 @@ If an `AssertionError` is thrown and a value is provided for the `message` parameter, the value of `message` will be appended to the `AssertionError` message: + ```js assert.doesNotThrow( () => { -- cgit v1.2.3