@@ -7,7 +7,7 @@ const repl = require('repl');
7
7
8
8
const stackRegExp = / ( a t .* r e p l : ) [ 0 - 9 ] + : [ 0 - 9 ] + / g;
9
9
10
- function run ( { command, expected, ...extraREPLOptions } ) {
10
+ function run ( { command, expected, ...extraREPLOptions } , i ) {
11
11
let accum = '' ;
12
12
13
13
const inputStream = new ArrayStream ( ) ;
@@ -25,6 +25,7 @@ function run({ command, expected, ...extraREPLOptions }) {
25
25
} ) ;
26
26
27
27
r . write ( `${ command } \n` ) ;
28
+ console . log ( i ) ;
28
29
assert . strictEqual (
29
30
accum . replace ( stackRegExp , '$1*:*' ) ,
30
31
expected . replace ( stackRegExp , '$1*:*' )
@@ -36,39 +37,39 @@ const tests = [
36
37
{
37
38
// Test .load for a file that throws.
38
39
command : `.load ${ fixtures . path ( 'repl-pretty-stack.js' ) } ` ,
39
- expected : 'Thrown:\nError : Whoops!\n at repl:*:*\n' +
40
+ expected : 'Uncaught Error : Whoops!\n at repl:*:*\n' +
40
41
' at d (repl:*:*)\n at c (repl:*:*)\n' +
41
42
' at b (repl:*:*)\n at a (repl:*:*)\n'
42
43
} ,
43
44
{
44
45
command : 'let x y;' ,
45
- expected : 'Thrown: \n' +
46
- 'let x y;\n ^\n\nSyntaxError : Unexpected identifier\n'
46
+ expected : 'let x y;\n ^\n \n' +
47
+ 'Uncaught SyntaxError : Unexpected identifier\n'
47
48
} ,
48
49
{
49
50
command : 'throw new Error(\'Whoops!\')' ,
50
- expected : 'Thrown:\nError : Whoops!\n'
51
+ expected : 'Uncaught Error : Whoops!\n'
51
52
} ,
52
53
{
53
54
command : '(() => { const err = Error(\'Whoops!\'); ' +
54
55
'err.foo = \'bar\'; throw err; })()' ,
55
- expected : "Thrown:\nError : Whoops!\n at repl:*:* {\n foo: 'bar'\n}\n" ,
56
+ expected : "Uncaught Error : Whoops!\n at repl:*:* {\n foo: 'bar'\n}\n" ,
56
57
} ,
57
58
{
58
59
command : '(() => { const err = Error(\'Whoops!\'); ' +
59
60
'err.foo = \'bar\'; throw err; })()' ,
60
- expected : 'Thrown:\nError : Whoops!\n at repl:*:* {\n foo: ' +
61
+ expected : 'Uncaught Error : Whoops!\n at repl:*:* {\n foo: ' +
61
62
"\u001b[32m'bar'\u001b[39m\n}\n" ,
62
63
useColors : true
63
64
} ,
64
65
{
65
66
command : 'foo = bar;' ,
66
- expected : 'Thrown:\nReferenceError : bar is not defined\n'
67
+ expected : 'Uncaught ReferenceError : bar is not defined\n'
67
68
} ,
68
69
// Test anonymous IIFE.
69
70
{
70
71
command : '(function() { throw new Error(\'Whoops!\'); })()' ,
71
- expected : 'Thrown:\nError : Whoops!\n at repl:*:*\n'
72
+ expected : 'Uncaught Error : Whoops!\n at repl:*:*\n'
72
73
}
73
74
] ;
74
75
0 commit comments