File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ module.exports = (text) => {
2828
2929 const runSteps = async ( steps ) => {
3030 for ( const step of steps ) {
31- event . emit ( event . bddStep . before , step ) ;
3231 const metaStep = new Step . MetaStep ( null , step . text ) ;
3332 metaStep . actor = step . keyword . trim ( ) ;
3433 const setMetaStep = ( step ) => {
@@ -44,10 +43,19 @@ module.exports = (text) => {
4443 if ( step . argument . type === 'DataTable' ) metaStep . comment = `\n${ transformTable ( step . argument ) } ` ;
4544 if ( step . argument . content ) metaStep . comment = `\n${ step . argument . content } ` ;
4645 }
46+ step . startTime = Date . now ( ) ;
47+ step . match = fn . line ;
48+ event . emit ( event . bddStep . before , step ) ;
4749 event . dispatcher . on ( event . step . before , setMetaStep ) ;
4850 try {
4951 await fn ( ...fn . params ) ;
52+ step . status = 'passed' ;
53+ } catch ( err ) {
54+ step . status = 'failed' ;
55+ step . err = err ;
56+ return err ;
5057 } finally {
58+ step . endTime = Date . now ( ) ;
5159 event . dispatcher . removeListener ( event . step . before , setMetaStep ) ;
5260 }
5361 event . emit ( event . bddStep . after , step ) ;
You can’t perform that action at this time.
0 commit comments