diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-07-17 08:23:49 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-07-19 08:47:28 +0200 |
commit | df08779e0dfa82ceb69e129ae0548e97352aaddf (patch) | |
tree | a589930afbeaf5481f3fe614eeee05fc04b7ec35 /test/parallel/test-http2-client-promisify-connect.js | |
parent | 373aae1f86c1d061123e3aec28980aa2e7d1ebd4 (diff) | |
download | android-node-v8-df08779e0dfa82ceb69e129ae0548e97352aaddf.tar.gz android-node-v8-df08779e0dfa82ceb69e129ae0548e97352aaddf.tar.bz2 android-node-v8-df08779e0dfa82ceb69e129ae0548e97352aaddf.zip |
test: make crashOnUnhandleRejection opt-out
This commit removes `common.crashOnUnhandledRejection()` and adds
`common.disableCrashOnUnhandledRejection()`.
To reduce the risk of mistakes and make writing tests that involve
promises simpler, always install the unhandledRejection hook in tests
and provide a way to disable it for the rare cases where it's needed.
PR-URL: https://github.com/nodejs/node/pull/21849
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-client-promisify-connect.js')
-rw-r--r-- | test/parallel/test-http2-client-promisify-connect.js | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/test/parallel/test-http2-client-promisify-connect.js b/test/parallel/test-http2-client-promisify-connect.js index 2eb7da3b9c..3e41bee49b 100644 --- a/test/parallel/test-http2-client-promisify-connect.js +++ b/test/parallel/test-http2-client-promisify-connect.js @@ -1,7 +1,6 @@ 'use strict'; const common = require('../common'); -common.crashOnUnhandledRejection(); if (!common.hasCrypto) common.skip('missing crypto'); @@ -18,7 +17,6 @@ server.listen(0, common.mustCall(() => { const connect = util.promisify(http2.connect); connect(`http://localhost:${server.address().port}`) - .catch(common.mustNotCall()) .then(common.mustCall((client) => { assert(client); const req = client.request(); |