summaryrefslogtreecommitdiff
path: root/doc/api/assert.md
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-04-25 00:46:40 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2019-04-27 18:22:27 +0200
commit31b3dd28429df7ea7ebc84bdfaf8d9eb9e417b41 (patch)
tree250f2f60d550a2b82ae6b94891df97579d16b0ea /doc/api/assert.md
parent38f3526f27c91181ec80ea488c177a49252aeb12 (diff)
downloadandroid-node-v8-31b3dd28429df7ea7ebc84bdfaf8d9eb9e417b41.tar.gz
android-node-v8-31b3dd28429df7ea7ebc84bdfaf8d9eb9e417b41.tar.bz2
android-node-v8-31b3dd28429df7ea7ebc84bdfaf8d9eb9e417b41.zip
tools: prohibit `assert.doesNotReject()` in Node.js core
This makes sure we do not use `assert.doesNotReject()` anywhere in our code base. This is just a simple wrapper that catches the rejection and then rejects it again in case of an error. Thus, it is not useful to do that. The error message for `assert.doesNotThrow()` is also improved. PR-URL: https://github.com/nodejs/node/pull/27402 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/assert.md')
-rw-r--r--doc/api/assert.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/api/assert.md b/doc/api/assert.md
index 9028d21f0d..0a7d35f105 100644
--- a/doc/api/assert.md
+++ b/doc/api/assert.md
@@ -454,6 +454,7 @@ function. See [`assert.throws()`][] for more details.
Besides the async nature to await the completion behaves identically to
[`assert.doesNotThrow()`][].
+<!-- eslint-disable no-restricted-syntax -->
```js
(async () => {
await assert.doesNotReject(
@@ -465,6 +466,7 @@ Besides the async nature to await the completion behaves identically to
})();
```
+<!-- eslint-disable no-restricted-syntax -->
```js
assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
.then(() => {