@@ -69,8 +69,21 @@ const registerHooks = () => {
69
69
// we need to reset the coverage when running
70
70
// in the interactive mode, otherwise the counters will
71
71
// keep increasing every time we rerun the tests
72
- // @ts -ignore
73
- cy . task ( 'resetCoverage' , { isInteractive : Cypress . config ( 'isInteractive' ) } )
72
+ const logInstance = Cypress . log ( {
73
+ name : 'Coverage' ,
74
+ message : [ 'Reset [@cypress/code-coverage]' ]
75
+ } )
76
+
77
+ cy . task (
78
+ 'resetCoverage' ,
79
+ {
80
+ // @ts -ignore
81
+ isInteractive : Cypress . config ( 'isInteractive' )
82
+ } ,
83
+ { log : false }
84
+ ) . then ( ( ) => {
85
+ logInstance . end ( )
86
+ } )
74
87
} )
75
88
76
89
beforeEach ( ( ) => {
@@ -105,7 +118,7 @@ const registerHooks = () => {
105
118
cy . on ( 'window:load' , saveCoverageObject )
106
119
107
120
// save reference if visiting a page inside a before() hook
108
- cy . window ( ) . then ( saveCoverageObject )
121
+ cy . window ( { log : false } ) . then ( saveCoverageObject )
109
122
} )
110
123
111
124
afterEach ( ( ) => {
@@ -187,8 +200,19 @@ const registerHooks = () => {
187
200
188
201
after ( function generateReport ( ) {
189
202
// when all tests finish, lets generate the coverage report
190
- cy . task ( 'coverageReport' , {
191
- timeout : Cypress . moment . duration ( 3 , 'minutes' ) . asMilliseconds ( )
203
+ const logInstance = Cypress . log ( {
204
+ name : 'Coverage' ,
205
+ message : [ 'Generating report [@cypress/code-coverage]' ]
206
+ } )
207
+ cy . task ( 'coverageReport' , null , {
208
+ timeout : Cypress . moment . duration ( 3 , 'minutes' ) . asMilliseconds ( ) ,
209
+ log : false
210
+ } ) . then ( coverageReportFolder => {
211
+ logInstance . set ( 'consoleProps' , ( ) => ( {
212
+ 'coverage report folder' : coverageReportFolder
213
+ } ) )
214
+ logInstance . end ( )
215
+ return coverageReportFolder
192
216
} )
193
217
} )
194
218
}
0 commit comments