summaryrefslogtreecommitdiff
path: root/test/parallel/test-async-wrap-pop-id-during-load.js
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-07-17 08:23:49 +0200
committerMichaël Zasso <targos@protonmail.com>2018-07-19 08:47:28 +0200
commitdf08779e0dfa82ceb69e129ae0548e97352aaddf (patch)
treea589930afbeaf5481f3fe614eeee05fc04b7ec35 /test/parallel/test-async-wrap-pop-id-during-load.js
parent373aae1f86c1d061123e3aec28980aa2e7d1ebd4 (diff)
downloadnode-new-df08779e0dfa82ceb69e129ae0548e97352aaddf.tar.gz
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-async-wrap-pop-id-during-load.js')
-rw-r--r--test/parallel/test-async-wrap-pop-id-during-load.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/parallel/test-async-wrap-pop-id-during-load.js b/test/parallel/test-async-wrap-pop-id-during-load.js
index ff3f637b87..31d2113eab 100644
--- a/test/parallel/test-async-wrap-pop-id-during-load.js
+++ b/test/parallel/test-async-wrap-pop-id-during-load.js
@@ -1,8 +1,9 @@
'use strict';
-require('../common');
+const common = require('../common');
if (process.argv[2] === 'async') {
+ common.disableCrashOnUnhandledRejection();
async function fn() {
fn();
throw new Error();