@@ -69,8 +69,21 @@ const registerHooks = () => {
6969    // we need to reset the coverage when running 
7070    // in the interactive mode, otherwise the counters will 
7171    // 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+     } ) 
7487  } ) 
7588
7689  beforeEach ( ( )  =>  { 
@@ -105,7 +118,7 @@ const registerHooks = () => {
105118    cy . on ( 'window:load' ,  saveCoverageObject ) 
106119
107120    // save reference if visiting a page inside a before() hook 
108-     cy . window ( ) . then ( saveCoverageObject ) 
121+     cy . window ( {   log :  false   } ) . then ( saveCoverageObject ) 
109122  } ) 
110123
111124  afterEach ( ( )  =>  { 
@@ -187,8 +200,19 @@ const registerHooks = () => {
187200
188201  after ( function  generateReport ( )  { 
189202    // 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 
192216    } ) 
193217  } ) 
194218} 
0 commit comments