summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-pretty-stack.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-12-28 14:32:16 +0100
committerAnna Henningsen <anna@addaleax.net>2019-01-02 14:58:47 +0100
commitedde0651912aca116f7e23c548bc5b56407a8056 (patch)
tree8eddbdc08e7022c4c59b63de915124fe8bb7cd5c /test/parallel/test-repl-pretty-stack.js
parent0ff1eb83d9c3416f9619c1ce2c3a7327efd9bee4 (diff)
downloadnode-new-edde0651912aca116f7e23c548bc5b56407a8056.tar.gz
repl: indicate if errors are thrown or not
Currently an error is printed identical, no matter if it is just inspected or if the error is thrown inside of the REPL. This makes sure we are able to distinguish these cases. PR-URL: https://github.com/nodejs/node/pull/25253 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/parallel/test-repl-pretty-stack.js')
-rw-r--r--test/parallel/test-repl-pretty-stack.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/parallel/test-repl-pretty-stack.js b/test/parallel/test-repl-pretty-stack.js
index f4754d315d..e4137b84a4 100644
--- a/test/parallel/test-repl-pretty-stack.js
+++ b/test/parallel/test-repl-pretty-stack.js
@@ -31,25 +31,27 @@ const tests = [
{
// test .load for a file that throws
command: `.load ${fixtures.path('repl-pretty-stack.js')}`,
- expected: 'Error: Whoops!\n at repl:9:24\n at d (repl:12:3)\n ' +
- 'at c (repl:9:3)\n at b (repl:6:3)\n at a (repl:3:3)\n'
+ expected: 'Thrown:\nError: Whoops!\n at repl:9:24\n' +
+ ' at d (repl:12:3)\n at c (repl:9:3)\n' +
+ ' at b (repl:6:3)\n at a (repl:3:3)\n'
},
{
command: 'let x y;',
- expected: 'let x y;\n ^\n\nSyntaxError: Unexpected identifier\n\n'
+ expected: 'Thrown:\n' +
+ 'let x y;\n ^\n\nSyntaxError: Unexpected identifier\n'
},
{
command: 'throw new Error(\'Whoops!\')',
- expected: 'Error: Whoops!\n'
+ expected: 'Thrown:\nError: Whoops!\n'
},
{
command: 'foo = bar;',
- expected: 'ReferenceError: bar is not defined\n'
+ expected: 'Thrown:\nReferenceError: bar is not defined\n'
},
// test anonymous IIFE
{
command: '(function() { throw new Error(\'Whoops!\'); })()',
- expected: 'Error: Whoops!\n at repl:1:21\n'
+ expected: 'Thrown:\nError: Whoops!\n at repl:1:21\n'
}
];