File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ if (Cypress.env('coverage') === false) {
23
23
const applicationSourceCoverage = win . __coverage__
24
24
25
25
if ( applicationSourceCoverage ) {
26
- cy . task ( 'combineCoverage' , applicationSourceCoverage )
26
+ cy . task ( 'combineCoverage' , JSON . stringify ( applicationSourceCoverage ) )
27
27
}
28
28
} )
29
29
} )
@@ -54,7 +54,7 @@ if (Cypress.env('coverage') === false) {
54
54
// original failed request
55
55
return
56
56
}
57
- cy . task ( 'combineCoverage' , coverage )
57
+ cy . task ( 'combineCoverage' , JSON . stringify ( coverage ) )
58
58
} )
59
59
}
60
60
@@ -75,7 +75,7 @@ if (Cypress.env('coverage') === false) {
75
75
( fileCoverage , filename ) =>
76
76
filename . startsWith ( specFolder ) || filename . startsWith ( supportFolder )
77
77
)
78
- cy . task ( 'combineCoverage' , coverage )
78
+ cy . task ( 'combineCoverage' , JSON . stringify ( coverage ) )
79
79
}
80
80
81
81
// when all tests finish, lets generate the coverage report
Original file line number Diff line number Diff line change @@ -61,8 +61,14 @@ module.exports = {
61
61
/**
62
62
* Combines coverage information from single test
63
63
* with previously collected coverage.
64
+ *
65
+ * @param {string } sentCoverage Stringified coverage object sent by the test runner
66
+ * @returns {null } Nothing is returned from this task
64
67
*/
65
- combineCoverage ( coverage ) {
68
+ combineCoverage ( sentCoverage ) {
69
+ const coverage = JSON . parse ( sentCoverage )
70
+ debug ( 'parsed sent coverage' )
71
+
66
72
fixSourcePathes ( coverage )
67
73
const previous = existsSync ( nycFilename )
68
74
? JSON . parse ( readFileSync ( nycFilename ) )
You can’t perform that action at this time.
0 commit comments