From 4d2d95a99f48e45513c7b4970361c9e0e8a89a4d Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 21 Oct 2011 15:48:01 -0400 Subject: [PATCH] [#25] Added test case error output for browser --- test/inc-testcase.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/inc-testcase.js b/test/inc-testcase.js index f87460d..bf625a8 100644 --- a/test/inc-testcase.js +++ b/test/inc-testcase.js @@ -150,6 +150,21 @@ function outputTestFailures( failures ) { var i, cur, name, e; + // if we don't have stdout access, throw an error containing each of the + // error strings + if ( typeof process === 'undefined' ) + { + var err = '', + i = failures.length; + + for ( i in failures ) + { + err += failures[ i ][ 0 ] + '; '; + } + + throw Error( err ); + } + for ( i = 0; i < failures.length; i++ ) { cur = failures[ i ];