File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,18 @@ const output = require('./output');
1313 */
1414class Actor {
1515 /**
16- * add print comment method`
16+ * Print the comment on log. Also, adding a step in the `Test.steps` object
1717 * @param {string } msg
1818 * @param {string } color
1919 * @inner
2020 *
2121 * ⚠️ returns a promise which is synchronized internally by recorder
2222 */
23- say ( msg , color = 'cyan' ) {
24- return recorder . add ( `say ${ msg } ` , ( ) => {
23+ async say ( msg , color = 'cyan' ) {
24+ const step = new Step ( 'say' , 'say' ) ;
25+ step . status = 'passed' ;
26+ return recordStep ( step , [ msg ] ) . then ( ( ) => {
27+ // this is backward compatibility as this event may be used somewhere
2528 event . emit ( event . step . comment , msg ) ;
2629 output . say ( msg , `${ color } ` ) ;
2730 } ) ;
Original file line number Diff line number Diff line change @@ -119,7 +119,9 @@ class Step {
119119 }
120120 let result ;
121121 try {
122- result = this . helper [ this . helperMethod ] . apply ( this . helper , this . args ) ;
122+ if ( this . helperMethod !== 'say' ) {
123+ result = this . helper [ this . helperMethod ] . apply ( this . helper , this . args ) ;
124+ }
123125 this . setStatus ( 'success' ) ;
124126 } catch ( err ) {
125127 this . setStatus ( 'failed' ) ;
You can’t perform that action at this time.
0 commit comments