From f2e0bbc2f6c660a76cda05a9fbc8ad764041d492 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sat, 3 Dec 2011 13:08:18 -0500 Subject: [PATCH] Outputting stack trace in browser tests if available --- test/inc-testcase.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/inc-testcase.js b/test/inc-testcase.js index 9065abe..429fcf9 100644 --- a/test/inc-testcase.js +++ b/test/inc-testcase.js @@ -353,7 +353,17 @@ function outputTestFailures( failures ) for ( i in failures ) { - err += failures[ i ][ 0 ] + '; '; + var failure = failures[ i ]; + + err += failure[ 0 ] + + ' (' + ( failure[ 1 ].message || 'no message' ) + ')' + + ( ( failure[ 1 ].stack ) + ? ( '
' + + failure[ 1 ].stack.replace( /\n/g, '
' ) + + '
' + ) + : '; ' + ) } throw Error( err );