summaryrefslogtreecommitdiff
path: root/test/parallel/test-promises-unhandled-symbol-rejections.js
diff options
context:
space:
mode:
authorMadara Uchiha <me@madara.ninja>2017-11-20 14:22:37 -0500
committerRefael Ackermann <refack@gmail.com>2017-11-22 17:33:52 -0500
commit13db29b2f7f0970c16228790f755262b3617f31e (patch)
treedcaa453067d22803df424683be9ab8fcfa0e52e2 /test/parallel/test-promises-unhandled-symbol-rejections.js
parentc6b7052bb714d167b16fb6db56bd3977ecddee90 (diff)
downloadnode-new-13db29b2f7f0970c16228790f755262b3617f31e.tar.gz
process: improve unhandled rejection message
PR-URL: https://github.com/nodejs/node/pull/17158 Refs: https://github.com/nodejs/node/pull/16768 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-promises-unhandled-symbol-rejections.js')
-rw-r--r--test/parallel/test-promises-unhandled-symbol-rejections.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/parallel/test-promises-unhandled-symbol-rejections.js b/test/parallel/test-promises-unhandled-symbol-rejections.js
index a60a5f2e8a..3e687d4e49 100644
--- a/test/parallel/test-promises-unhandled-symbol-rejections.js
+++ b/test/parallel/test-promises-unhandled-symbol-rejections.js
@@ -1,17 +1,24 @@
'use strict';
const common = require('../common');
+const expectedValueWarning = 'Symbol()';
const expectedDeprecationWarning = 'Unhandled promise rejections are ' +
'deprecated. In the future, promise ' +
'rejections that are not handled will ' +
'terminate the Node.js process with a ' +
'non-zero exit code.';
-const expectedPromiseWarning = 'Unhandled promise rejection (rejection id: ' +
- '1): Symbol()';
+const expectedPromiseWarning = 'Unhandled promise rejection. ' +
+ 'This error originated either by throwing ' +
+ 'inside of an async function without a catch ' +
+ 'block, or by rejecting a promise which was ' +
+ 'not handled with .catch(). (rejection id: 1)';
common.expectWarning({
DeprecationWarning: expectedDeprecationWarning,
- UnhandledPromiseRejectionWarning: expectedPromiseWarning,
+ UnhandledPromiseRejectionWarning: [
+ expectedPromiseWarning,
+ expectedValueWarning
+ ],
});
// ensure this doesn't crash