This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,27 @@ exports.task = function (done) {
66 configFile : root + '/config/karma.conf.js'
77 } ;
88
9+ var errorCount = 0 ;
10+
11+ function captureError ( next ) {
12+ return function ( exitCode ) {
13+ if ( exitCode != 0 ) {
14+ gutil . log ( gutil . colors . red ( "Karma exited with the following exit code: " + exitCode ) ) ;
15+ errorCount ++ ;
16+ }
17+ next ( ) ;
18+ } ;
19+ }
20+
21+
922 gutil . log ( 'Running unit tests on unminified source.' ) ;
1023 buildJs ( true ) ;
11- karma . start ( karmaConfig , testMinified ) ;
24+ karma . start ( karmaConfig , captureError ( testMinified ) ) ;
1225
1326 function testMinified ( ) {
1427 gutil . log ( 'Running unit tests on minified source.' ) ;
1528 process . env . KARMA_TEST_COMPRESSED = true ;
16- karma . start ( karmaConfig , testMinifiedJquery ) ;
29+ karma . start ( karmaConfig , captureError ( testMinifiedJquery ) ) ;
1730 }
1831
1932 function testMinifiedJquery ( ) {
@@ -26,6 +39,8 @@ exports.task = function (done) {
2639 function clearEnv ( ) {
2740 process . env . KARMA_TEST_COMPRESSED = undefined ;
2841 process . env . KARMA_TEST_JQUERY = undefined ;
42+
43+ if ( errorCount > 0 ) { process . exit ( errorCount ) ; }
2944 done ( ) ;
3045 }
3146} ;
You can’t perform that action at this time.
0 commit comments