summaryrefslogtreecommitdiff
path: root/test/parallel/test-internal-errors.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-04-04 17:03:58 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2018-04-23 15:33:50 +0200
commitf85d5996db11107edb4d078f5eafcd4cc588cd9c (patch)
tree356ae1cbb41f626f0410df66e23f240c7d7abad2 /test/parallel/test-internal-errors.js
parentc1078c4a3bf1a1b2e83d4ca5965b8f9fba26b166 (diff)
downloadandroid-node-v8-f85d5996db11107edb4d078f5eafcd4cc588cd9c.tar.gz
android-node-v8-f85d5996db11107edb4d078f5eafcd4cc588cd9c.tar.bz2
android-node-v8-f85d5996db11107edb4d078f5eafcd4cc588cd9c.zip
test: improve common.expectsError
The output is now improved by showing most properties all at once. Besides that this adds a warning to use `assert.throws` instead due to a better output. PR-URL: https://github.com/nodejs/node/pull/19797 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test/parallel/test-internal-errors.js')
-rw-r--r--test/parallel/test-internal-errors.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-internal-errors.js b/test/parallel/test-internal-errors.js
index a161a1db69..cd2028c0f2 100644
--- a/test/parallel/test-internal-errors.js
+++ b/test/parallel/test-internal-errors.js
@@ -77,7 +77,7 @@ common.expectsError(() => {
}, { code: 'TEST_ERROR_1', type: RangeError });
}, {
code: 'ERR_ASSERTION',
- message: /^.+ is not instance of \S/
+ message: /- type: \[Function: TypeError]\n\+ type: \[Function: RangeError]/
});
common.expectsError(() => {
@@ -89,7 +89,7 @@ common.expectsError(() => {
}, {
code: 'ERR_ASSERTION',
type: assert.AssertionError,
- message: /.+ does not match \S/
+ message: /- message: 'Error for testing purposes: a'\n\+ message: \/\^Error/
});
// Test ERR_INVALID_FD_TYPE