@@ -7,7 +7,7 @@ const repl = require('repl');
77
88const  stackRegExp  =  / ( a t   .* r e p l : ) [ 0 - 9 ] + : [ 0 - 9 ] + / g; 
99
10- function  run ( {  command,  expected,  ...extraREPLOptions  } )  { 
10+ function  run ( {  command,  expected,  ...extraREPLOptions  } ,   i )  { 
1111  let  accum  =  '' ; 
1212
1313  const  inputStream  =  new  ArrayStream ( ) ; 
@@ -25,6 +25,7 @@ function run({ command, expected, ...extraREPLOptions }) {
2525  } ) ; 
2626
2727  r . write ( `${ command }  \n` ) ; 
28+   console . log ( i ) ; 
2829  assert . strictEqual ( 
2930    accum . replace ( stackRegExp ,  '$1*:*' ) , 
3031    expected . replace ( stackRegExp ,  '$1*:*' ) 
@@ -36,39 +37,39 @@ const tests = [
3637  { 
3738    // Test .load for a file that throws. 
3839    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'  + 
4041              '    at d (repl:*:*)\n    at c (repl:*:*)\n'  + 
4142              '    at b (repl:*:*)\n    at a (repl:*:*)\n' 
4243  } , 
4344  { 
4445    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' 
4748  } , 
4849  { 
4950    command : 'throw new Error(\'Whoops!\')' , 
50-     expected : 'Thrown:\nError : Whoops!\n' 
51+     expected : 'Uncaught Error : Whoops!\n' 
5152  } , 
5253  { 
5354    command : '(() => { const err = Error(\'Whoops!\'); '  + 
5455             '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" , 
5657  } , 
5758  { 
5859    command : '(() => { const err = Error(\'Whoops!\'); '  + 
5960             '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: '  + 
6162              "\u001b[32m'bar'\u001b[39m\n}\n" , 
6263    useColors : true 
6364  } , 
6465  { 
6566    command : 'foo = bar;' , 
66-     expected : 'Thrown:\nReferenceError : bar is not defined\n' 
67+     expected : 'Uncaught ReferenceError : bar is not defined\n' 
6768  } , 
6869  // Test anonymous IIFE. 
6970  { 
7071    command : '(function() { throw new Error(\'Whoops!\'); })()' , 
71-     expected : 'Thrown:\nError : Whoops!\n    at repl:*:*\n' 
72+     expected : 'Uncaught Error : Whoops!\n    at repl:*:*\n' 
7273  } 
7374] ; 
7475
0 commit comments