summaryrefslogtreecommitdiff
path: root/test/parallel/test-promises-unhandled-proxy-rejections.js
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-03-20 12:39:46 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-03-26 10:29:34 +0200
commit8fb4ea9f75c8c82c46286bd5ca0c1115c4a5e956 (patch)
tree76c01165a604c4785043224d8b815984e2cda9b2 /test/parallel/test-promises-unhandled-proxy-rejections.js
parentebbf3936001969905ce28dc588b2c71c3b65c146 (diff)
downloadandroid-node-v8-8fb4ea9f75c8c82c46286bd5ca0c1115c4a5e956.tar.gz
android-node-v8-8fb4ea9f75c8c82c46286bd5ca0c1115c4a5e956.tar.bz2
android-node-v8-8fb4ea9f75c8c82c46286bd5ca0c1115c4a5e956.zip
test: add deprecation code to expectWarning
This commit adds a deprecation code to expectWarning and updates the function to check the passed code against the code property on the warning object. Not all warnings have a deprecation code so for those that don't an explicit code of common.noWarnCode is required. Passing this skips the assertion of the code. PR-URL: https://github.com/nodejs/node/pull/19474 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'test/parallel/test-promises-unhandled-proxy-rejections.js')
-rw-r--r--test/parallel/test-promises-unhandled-proxy-rejections.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-promises-unhandled-proxy-rejections.js b/test/parallel/test-promises-unhandled-proxy-rejections.js
index f632857d63..dfd1ee322a 100644
--- a/test/parallel/test-promises-unhandled-proxy-rejections.js
+++ b/test/parallel/test-promises-unhandled-proxy-rejections.js
@@ -1,16 +1,16 @@
'use strict';
const common = require('../common');
-const expectedDeprecationWarning = 'Unhandled promise rejections are ' +
+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. ' +
+ 'non-zero exit code.', 'DEP0018'];
+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)';
+ 'not handled with .catch(). (rejection id: 1)', common.noWarnCode];
function throwErr() {
throw new Error('Error from proxy');