@@ -278,31 +278,28 @@ function Run (testsuite) {
278278 PASSED += result . passed ;
279279 FAILED += result . failed ;
280280 DURATION += result . duration ;
281- COMPLETE [ suite . suiteName ] = COMPLETE [ suite . suiteName ] || { } ;
282281
283282 let duplicates = [ ] ;
284- // Reference will be modified within complete
285- let cmpl = COMPLETE [ suite . suiteName ] ;
286283 for ( var attrname in RESULTS ) {
287284 if ( typeof ( RESULTS [ attrname ] ) === 'number' ) {
288- if ( ! cmpl . hasOwnProperty ( attrname ) ) {
289- cmpl [ attrname ] = { } ;
285+ if ( ! COMPLETE . hasOwnProperty ( attrname ) ) {
286+ COMPLETE [ attrname ] = { } ;
290287 }
291- cmpl [ attrname ] = RESULTS [ attrname ] ;
288+ COMPLETE [ attrname ] [ suite . suiteName ] = RESULTS [ attrname ] ;
292289 } else if ( RESULTS . hasOwnProperty ( attrname ) ) {
293- if ( cmpl . hasOwnProperty ( attrname ) ) {
290+ if ( COMPLETE . hasOwnProperty ( attrname ) ) {
294291 if ( attrname === 'message' ) {
295- cmpl [ attrname ] += "\n\n" + RESULTS [ attrname ] ;
292+ COMPLETE [ attrname ] += "\n\n" + RESULTS [ attrname ] ;
296293 continue ;
297294 }
298- print ( "Duplicate testcase '" + suite . suiteName + "::" + attrname + "' - already have: " + JSON . stringify ( cmpl [ attrname ] ) + "" ) ;
295+ print ( "Duplicate testsuite '" + attrname + "' - already have: " + JSON . stringify ( COMPLETE [ attrname ] ) + "" ) ;
299296 duplicates . push ( attrname ) ;
300297 }
301- cmpl [ attrname ] = RESULTS [ attrname ] ;
298+ COMPLETE [ attrname ] = RESULTS [ attrname ] ;
302299 }
303300 }
304301 if ( duplicates . length !== 0 ) {
305- throw ( "Duplicate testcase '" + duplicates + "'" ) ;
302+ throw ( "Duplicate testsuite '" + duplicates + "'" ) ;
306303 }
307304 return result ;
308305}
0 commit comments