File tree 2 files changed +9
-4
lines changed 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');
13
13
*/
14
14
class Actor {
15
15
/**
16
- * add print comment method`
16
+ * Print the comment on log. Also, adding a step in the `Test.steps` object
17
17
* @param {string } msg
18
18
* @param {string } color
19
19
* @inner
20
20
*
21
21
* ⚠️ returns a promise which is synchronized internally by recorder
22
22
*/
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
25
28
event . emit ( event . step . comment , msg ) ;
26
29
output . say ( msg , `${ color } ` ) ;
27
30
} ) ;
Original file line number Diff line number Diff line change @@ -119,7 +119,9 @@ class Step {
119
119
}
120
120
let result ;
121
121
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
+ }
123
125
this . setStatus ( 'success' ) ;
124
126
} catch ( err ) {
125
127
this . setStatus ( 'failed' ) ;
You can’t perform that action at this time.
0 commit comments