@@ -19,7 +19,10 @@ module.exports = function (report, appDirectory, options) {
19
19
'testsuites' : [
20
20
{
21
21
'_attr' : {
22
- 'name' : options . suiteName
22
+ 'name' : options . suiteName ,
23
+ 'tests' : 0 ,
24
+ 'failures' : 0 ,
25
+ 'time' : 0
23
26
}
24
27
}
25
28
]
@@ -53,6 +56,9 @@ module.exports = function (report, appDirectory, options) {
53
56
suiteReplacementMap [ constants . TITLE_VAR ] = suiteTitle ;
54
57
55
58
// Add <testsuite /> properties
59
+ const suiteNumTests = suite . numFailingTests + suite . numPassingTests + suite . numPendingTests ;
60
+ const suiteExecutionTime = ( suite . perfStats . end - suite . perfStats . start ) / 1000 ;
61
+
56
62
let testSuite = {
57
63
'testsuite' : [ {
58
64
_attr : {
@@ -61,12 +67,17 @@ module.exports = function (report, appDirectory, options) {
61
67
failures : suite . numFailingTests ,
62
68
skipped : suite . numPendingTests ,
63
69
timestamp : ( new Date ( suite . perfStats . start ) ) . toISOString ( ) . slice ( 0 , - 5 ) ,
64
- time : ( suite . perfStats . end - suite . perfStats . start ) / 1000 ,
65
- tests : suite . numFailingTests + suite . numPassingTests + suite . numPendingTests
70
+ time : suiteExecutionTime ,
71
+ tests : suiteNumTests
66
72
}
67
73
} ]
68
74
} ;
69
75
76
+ // Update top level testsuites properties
77
+ jsonResults . testsuites [ 0 ] . _attr . failures += suite . numFailingTests ;
78
+ jsonResults . testsuites [ 0 ] . _attr . tests += suiteNumTests ;
79
+ jsonResults . testsuites [ 0 ] . _attr . time += suiteExecutionTime ;
80
+
70
81
// Iterate through test cases
71
82
suite . testResults . forEach ( ( tc ) => {
72
83
const classname = tc . ancestorTitles . join ( options . ancestorSeparator ) ;
0 commit comments