File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ function encodeResult (res, count) {
8181 output += inner + 'expected: ' + ex + '\n' ;
8282 output += inner + 'actual: ' + ac + '\n' ;
8383 }
84+ if ( res . operator === 'error' && res . actual && res . actual . stack ) {
85+ var lines = String ( res . actual . stack ) . split ( '\n' ) ;
86+ output += inner + 'stack:\n' ;
87+ output += inner + ' ' + lines [ 0 ] + '\n' ;
88+ for ( var i = 1 ; i < lines . length ; i ++ ) {
89+ output += inner + lines [ i ] + '\n' ;
90+ }
91+ }
8492
8593 output += outer + '...\n' ;
8694 }
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ Test.prototype.error
184184= Test . prototype . iferror
185185= function ( err , msg , extra ) {
186186 this . _assert ( ! err , {
187- message : defined ( msg , err . message ) ,
187+ message : defined ( msg , String ( err ) ) ,
188188 operator : 'error' ,
189189 actual : err ,
190190 extra : extra
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ tap.test('throw test', function (tt) {
2121 'TAP version 13' ,
2222 'thrower' ,
2323 { id : 1 , ok : true , name : 'should be equal' } ,
24- { id : 2 , ok : false , name : 'rawr' } ,
24+ { id : 2 , ok : false , name : 'Error: rawr' } ,
2525 'tests 2' ,
2626 'pass 1' ,
2727 'fail 1' ,
You can’t perform that action at this time.
0 commit comments